conflict_resolution
stringlengths
27
16k
<<<<<<< import java.util.stream.Collectors; import java.util.stream.Stream; ======= import java.util.concurrent.TimeUnit; import java.util.function.UnaryOperator; import javax.annotation.Nullable; >>>>>>> import java.util.stream.Collectors; import java.util.stream.Stream; import java.util.concurrent.TimeUnit; import java.util.function.UnaryOperator; import javax.annotation.Nullable; <<<<<<< import org.eclipse.ditto.services.gateway.endpoints.directives.ContentTypeValidationDirective; ======= import org.eclipse.ditto.services.gateway.util.config.endpoints.CommandConfig; >>>>>>> import org.eclipse.ditto.services.gateway.endpoints.directives.ContentTypeValidationDirective; import org.eclipse.ditto.services.gateway.util.config.endpoints.CommandConfig; <<<<<<< import akka.http.javadsl.model.MediaTypes; ======= import akka.http.javadsl.model.headers.TimeoutAccess; >>>>>>> import akka.http.javadsl.model.headers.TimeoutAccess; import akka.http.javadsl.model.MediaTypes; <<<<<<< /** * Provides a composed directive of {@link AllDirectives#extractDataBytes} and * {@link ContentTypeValidationDirective#ensureValidContentType}, where the supported media-types are * application/json and the fallback/additional media-types from config. * * @param ctx The context of a request. * @param dittoHeaders The ditto headers of a request. * @param inner route directive to handles the extracted payload. * @return Route. */ protected Route ensureMediaTypeJsonWithFallbacksThenExtractDataBytes(final RequestContext ctx, final DittoHeaders dittoHeaders, final java.util.function.Function<Source<ByteString, Object>, Route> inner) { return ContentTypeValidationDirective.ensureValidContentType(mediaTypeJsonWithFallbacks, ctx, dittoHeaders, () -> extractDataBytes(inner)); } ======= /** * Configures the passed {@code optionalTimeout} as Akka HTTP request timeout validating it with the passed * {@code checkTimeoutFunction} falling back to the optional {@code defaultTimeout} wrapping the passed * {@code inner} route. * * @param optionalTimeout the custom timeout to use as Akka HTTP request timeout adjusting the configured default * one. * @param checkTimeoutFunction a function to check the passed optionalTimeout for validity e. g. within some bounds. * @param defaultTimeout an optional default timeout if the passed optionalTimeout was not set. * @param inner the inner Route to wrap. * @return the wrapped route - potentially with custom timeout adjusted. */ protected Route withCustomRequestTimeout(@Nullable final Duration optionalTimeout, final UnaryOperator<Duration> checkTimeoutFunction, @Nullable final Duration defaultTimeout, final java.util.function.Function<Duration, Route> inner) { @Nullable Duration customRequestTimeout = defaultTimeout; if (null != optionalTimeout) { customRequestTimeout = checkTimeoutFunction.apply(optionalTimeout); } if (null != customRequestTimeout) { return increaseHttpRequestTimeout(inner, customRequestTimeout); } else { return extractRequestTimeout(configuredTimeout -> increaseHttpRequestTimeout(inner, configuredTimeout)); } } private Route increaseHttpRequestTimeout(final java.util.function.Function<Duration, Route> inner, final Duration requestTimeout) { return increaseHttpRequestTimeout(inner, scala.concurrent.duration.Duration.create(requestTimeout.toMillis(), TimeUnit.MILLISECONDS)); } private Route increaseHttpRequestTimeout(final java.util.function.Function<Duration, Route> inner, final scala.concurrent.duration.Duration requestTimeout) { if (requestTimeout.isFinite()) { // adds some time in order to avoid race conditions with internal receiveTimeouts which shall return "408" // in case of message timeouts or "424" in case of requested-acks timeouts: final scala.concurrent.duration.Duration akkaHttpRequestTimeout = requestTimeout .plus(scala.concurrent.duration.Duration.create(5, TimeUnit.SECONDS)); return withRequestTimeout(akkaHttpRequestTimeout, () -> inner.apply(Duration.ofMillis(requestTimeout.toMillis())) ); } else { return inner.apply(Duration.ofMillis(Long.MAX_VALUE)); } } /** * Validates the passed {@code timeout} based on the configured {@link CommandConfig#getMaxTimeout()} as the upper * bound. * * @param timeout the timeout to validate. * @return the passed in timeout if it was valid. * @throws GatewayTimeoutInvalidException if the passed {@code timeout} was not within its bounds. */ protected Duration validateCommandTimeout(final Duration timeout) { final Duration maxTimeout = commandConfig.getMaxTimeout(); // check if the timeout is smaller than the maximum possible timeout and > 0: if (timeout.isNegative() || timeout.compareTo(maxTimeout) > 0) { throw GatewayTimeoutInvalidException.newBuilder(timeout, maxTimeout) .build(); } return timeout; } >>>>>>> /** * Provides a composed directive of {@link AllDirectives#extractDataBytes} and * {@link ContentTypeValidationDirective#ensureValidContentType}, where the supported media-types are * application/json and the fallback/additional media-types from config. * * @param ctx The context of a request. * @param dittoHeaders The ditto headers of a request. * @param inner route directive to handles the extracted payload. * @return Route. */ protected Route ensureMediaTypeJsonWithFallbacksThenExtractDataBytes(final RequestContext ctx, final DittoHeaders dittoHeaders, final java.util.function.Function<Source<ByteString, Object>, Route> inner) { return ContentTypeValidationDirective.ensureValidContentType(mediaTypeJsonWithFallbacks, ctx, dittoHeaders, () -> extractDataBytes(inner)); } /** * Configures the passed {@code optionalTimeout} as Akka HTTP request timeout validating it with the passed * {@code checkTimeoutFunction} falling back to the optional {@code defaultTimeout} wrapping the passed * {@code inner} route. * * @param optionalTimeout the custom timeout to use as Akka HTTP request timeout adjusting the configured default * one. * @param checkTimeoutFunction a function to check the passed optionalTimeout for validity e. g. within some bounds. * @param defaultTimeout an optional default timeout if the passed optionalTimeout was not set. * @param inner the inner Route to wrap. * @return the wrapped route - potentially with custom timeout adjusted. */ protected Route withCustomRequestTimeout(@Nullable final Duration optionalTimeout, final UnaryOperator<Duration> checkTimeoutFunction, @Nullable final Duration defaultTimeout, final java.util.function.Function<Duration, Route> inner) { @Nullable Duration customRequestTimeout = defaultTimeout; if (null != optionalTimeout) { customRequestTimeout = checkTimeoutFunction.apply(optionalTimeout); } if (null != customRequestTimeout) { return increaseHttpRequestTimeout(inner, customRequestTimeout); } else { return extractRequestTimeout(configuredTimeout -> increaseHttpRequestTimeout(inner, configuredTimeout)); } } private Route increaseHttpRequestTimeout(final java.util.function.Function<Duration, Route> inner, final Duration requestTimeout) { return increaseHttpRequestTimeout(inner, scala.concurrent.duration.Duration.create(requestTimeout.toMillis(), TimeUnit.MILLISECONDS)); } private Route increaseHttpRequestTimeout(final java.util.function.Function<Duration, Route> inner, final scala.concurrent.duration.Duration requestTimeout) { if (requestTimeout.isFinite()) { // adds some time in order to avoid race conditions with internal receiveTimeouts which shall return "408" // in case of message timeouts or "424" in case of requested-acks timeouts: final scala.concurrent.duration.Duration akkaHttpRequestTimeout = requestTimeout .plus(scala.concurrent.duration.Duration.create(5, TimeUnit.SECONDS)); return withRequestTimeout(akkaHttpRequestTimeout, () -> inner.apply(Duration.ofMillis(requestTimeout.toMillis())) ); } else { return inner.apply(Duration.ofMillis(Long.MAX_VALUE)); } } /** * Validates the passed {@code timeout} based on the configured {@link CommandConfig#getMaxTimeout()} as the upper * bound. * * @param timeout the timeout to validate. * @return the passed in timeout if it was valid. * @throws GatewayTimeoutInvalidException if the passed {@code timeout} was not within its bounds. */ protected Duration validateCommandTimeout(final Duration timeout) { final Duration maxTimeout = commandConfig.getMaxTimeout(); // check if the timeout is smaller than the maximum possible timeout and > 0: if (timeout.isNegative() || timeout.compareTo(maxTimeout) > 0) { throw GatewayTimeoutInvalidException.newBuilder(timeout, maxTimeout) .build(); } return timeout; }
<<<<<<< import java.util.Collections; import java.util.HashMap; import java.util.Map; ======= import java.util.Collections; import java.util.Map; >>>>>>> import java.util.Collections; import java.util.Map; <<<<<<< ======= import java.util.function.Function; import java.util.stream.Collectors; import java.util.stream.Stream; >>>>>>> import java.util.function.Function; import java.util.stream.Collectors; import java.util.stream.Stream; <<<<<<< return Optional.ofNullable(STATUS_CODES_MAP.get(statusCodeAsInt)); ======= return Optional.ofNullable(STATUS_CODE_INDEX.get(statusCodeAsInt)); >>>>>>> return Optional.ofNullable(STATUS_CODE_INDEX.get(statusCodeAsInt));
<<<<<<< import org.eclipse.ditto.services.gateway.streaming.StreamingSessionIdentifier; ======= import org.eclipse.ditto.services.gateway.streaming.actors.EventAndResponsePublisher; >>>>>>> <<<<<<< return publisherSource.mapMaterializedValue( withQueue -> { final String requestCorrelationId = dittoHeaders.getCorrelationId() ======= return publisherSource.viaMat(KillSwitches.single(), Keep.both()) .mapMaterializedValue(pair -> { final ActorRef publisherActor = pair.first(); final KillSwitch killSwitch = pair.second(); final String connectionCorrelationId = dittoHeaders.getCorrelationId() >>>>>>> return publisherSource.viaMat(KillSwitches.single(), Keep.both()) .mapMaterializedValue(pair -> { final SupervisedStream.WithQueue withQueue = pair.first(); final KillSwitch killSwitch = pair.second(); final String connectionCorrelationId = dittoHeaders.getCorrelationId() <<<<<<< sseConnectionSupervisor.supervise(withQueue.getSupervisedStream(), connectionCorrelationId, dittoHeaders); streamingActor.tell( new Connect(withQueue.getSourceQueue(), connectionCorrelationId, STREAMING_TYPE_SSE, jsonSchemaVersion, null), null); ======= sseConnectionSupervisor.supervise(publisherActor, connectionCorrelationId, dittoHeaders); final Connect connect = new Connect(publisherActor, connectionCorrelationId, STREAMING_TYPE_SSE, jsonSchemaVersion, null); >>>>>>> sseConnectionSupervisor.supervise(withQueue.getSupervisedStream(), connectionCorrelationId, dittoHeaders); final Connect connect = new Connect(withQueue.getSourceQueue(), connectionCorrelationId, STREAMING_TYPE_SSE, jsonSchemaVersion, null);
<<<<<<< import javax.annotation.Nullable; ======= import org.eclipse.ditto.json.JsonFieldDefinition; import org.eclipse.ditto.json.JsonKey; import org.eclipse.ditto.json.JsonPointer; >>>>>>> import javax.annotation.Nullable; import org.eclipse.ditto.json.JsonFieldDefinition; import org.eclipse.ditto.json.JsonKey; import org.eclipse.ditto.json.JsonPointer; <<<<<<< import org.eclipse.ditto.services.base.config.http.HttpConfig; import org.eclipse.ditto.services.base.config.limits.LimitsConfig; ======= import org.eclipse.ditto.model.things.Thing; import org.eclipse.ditto.services.base.config.HttpConfigReader; import org.eclipse.ditto.services.base.config.ServiceConfigReader; import org.eclipse.ditto.services.thingsearch.common.util.ConfigKeys; >>>>>>> import org.eclipse.ditto.model.things.Thing; import org.eclipse.ditto.services.base.config.http.HttpConfig; import org.eclipse.ditto.services.base.config.limits.LimitsConfig; <<<<<<< ======= import com.mongodb.reactivestreams.client.MongoDatabase; import com.typesafe.config.Config; >>>>>>> import com.mongodb.reactivestreams.client.MongoDatabase; <<<<<<< final DittoMongoClient mongoDbClient = MongoClientWrapper.getBuilder(mongoDbConfig) .addCommandListener(getCommandListenerOrNull(monitoringConfig)) .addConnectionPoolListener(getConnectionPoolListenerOrNull(monitoringConfig)) ======= final DittoMongoClient dittoMongoClient = MongoClientWrapper.getBuilder(MongoConfig.of(rawConfig)) .addCommandListener(kamonCommandListener) .addConnectionPoolListener(kamonConnectionPoolListener) >>>>>>> final DittoMongoClient mongoDbClient = MongoClientWrapper.getBuilder(mongoDbConfig) .addCommandListener(getCommandListenerOrNull(monitoringConfig)) .addConnectionPoolListener(getConnectionPoolListenerOrNull(monitoringConfig)) <<<<<<< MongoTimestampPersistence.initializedInstance(THINGS_SYNC_STATE_COLLECTION_NAME, mongoDbClient, ======= MongoTimestampPersistence.initializedInstance(THINGS_SYNC_STATE_COLLECTION_NAME, dittoMongoClient, >>>>>>> MongoTimestampPersistence.initializedInstance(THINGS_SYNC_STATE_COLLECTION_NAME, mongoDbClient, <<<<<<< pubSubMediator.tell(new DistributedPubSubMediator.Put(searchActor), getSelf()); createHealthCheckingActorHttpBinding(searchConfig.getHttpConfig(), healthCheckingActor, materializer); ======= createHealthCheckingActorHttpBinding(configReader.http(), healthCheckingActor, materializer); >>>>>>> createHealthCheckingActorHttpBinding(searchConfig.getHttpConfig(), healthCheckingActor, materializer); <<<<<<< @Nullable private static CommandListener getCommandListenerOrNull(final MongoDbConfig.MonitoringConfig monitoringConfig) { return monitoringConfig.isCommandsEnabled() ? new KamonCommandListener(KAMON_METRICS_PREFIX) : null; } @Nullable private static ConnectionPoolListener getConnectionPoolListenerOrNull( final MongoDbConfig.MonitoringConfig monitoringConfig) { return monitoringConfig.isConnectionPoolEnabled() ? new KamonConnectionPoolListener(KAMON_METRICS_PREFIX) : null; } ======= private ActorRef initializeSearchActor(final ServiceConfigReader configReader, final MongoDatabase database) { final Config rawConfig = configReader.getRawConfig(); final ThingsSearchPersistence thingsSearchPersistence = initializeSearchPersistence(database, getContext().getSystem(), rawConfig); >>>>>>> @Nullable private static CommandListener getCommandListenerOrNull(final MongoDbConfig.MonitoringConfig monitoringConfig) { return monitoringConfig.isCommandsEnabled() ? new KamonCommandListener(KAMON_METRICS_PREFIX) : null; } @Nullable private static ConnectionPoolListener getConnectionPoolListenerOrNull( final MongoDbConfig.MonitoringConfig monitoringConfig) { return monitoringConfig.isConnectionPoolEnabled() ? new KamonConnectionPoolListener(KAMON_METRICS_PREFIX) : null; } <<<<<<< final ThingsFieldExpressionFactory fieldExpressionFactory = new ThingsFieldExpressionFactoryImpl(); final AggregationBuilderFactory aggregationBuilderFactory = new MongoAggregationBuilderFactory(limitsConfig); final QueryBuilderFactory queryBuilderFactory = new MongoQueryBuilderFactory(limitsConfig); final ActorRef aggregationQueryActor = startChildActor(AggregationQueryActor.ACTOR_NAME, AggregationQueryActor.props(criteriaFactory, fieldExpressionFactory, aggregationBuilderFactory)); final ActorRef apiV1QueryActor = startChildActor(QueryActor.ACTOR_NAME, QueryActor.props(criteriaFactory, fieldExpressionFactory, queryBuilderFactory)); ======= final ThingsFieldExpressionFactory expressionFactory = getThingsFieldExpressionFactory(); final QueryBuilderFactory queryBuilderFactory = new MongoQueryBuilderFactory(configReader.limits()); final QueryParser queryFactory = QueryParser.of(criteriaFactory, expressionFactory, queryBuilderFactory); final Props searchActorProps = SearchActor.props(queryFactory, thingsSearchPersistence); >>>>>>> final ThingsFieldExpressionFactory fieldExpressionFactory = getThingsFieldExpressionFactory(); final QueryBuilderFactory queryBuilderFactory = new MongoQueryBuilderFactory(limitsConfig); final QueryParser queryFactory = QueryParser.of(criteriaFactory, fieldExpressionFactory, queryBuilderFactory); <<<<<<< log.info("Gracefully shutting down status/health HTTP endpoint ..."); ======= log.info("Gracefully shutting down status/health HTTP endpoint.."); >>>>>>> log.info("Gracefully shutting down status/health HTTP endpoint ...");
<<<<<<< private final PingConfig pingConfig; ======= private final ReconnectConfig reconnectConfig; private final ConnectionIdsRetrievalConfig connectionIdsRetrievalConfig; >>>>>>> private final PingConfig pingConfig; private final ConnectionIdsRetrievalConfig connectionIdsRetrievalConfig; <<<<<<< pingConfig = DefaultPingConfig.of(serviceSpecificConfig); ======= reconnectConfig = DefaultReconnectConfig.of(serviceSpecificConfig); connectionIdsRetrievalConfig = DefaultConnectionIdsRetrievalConfig.of(serviceSpecificConfig); >>>>>>> pingConfig = DefaultPingConfig.of(serviceSpecificConfig); connectionIdsRetrievalConfig = DefaultConnectionIdsRetrievalConfig.of(serviceSpecificConfig); <<<<<<< Objects.equals(pingConfig, that.pingConfig) && ======= Objects.equals(reconnectConfig, that.reconnectConfig) && Objects.equals(connectionIdsRetrievalConfig, that.connectionIdsRetrievalConfig) && >>>>>>> Objects.equals(pingConfig, that.pingConfig) && Objects.equals(connectionIdsRetrievalConfig, that.connectionIdsRetrievalConfig) && <<<<<<< connectionConfig, pingConfig, clientConfig, protocolConfig, ======= connectionConfig, reconnectConfig, connectionIdsRetrievalConfig, clientConfig, protocolConfig, >>>>>>> connectionConfig, pingConfig, connectionIdsRetrievalConfig, clientConfig, protocolConfig, <<<<<<< ", pingConfig=" + pingConfig + ======= ", reconnectConfig=" + reconnectConfig + ", connectionIdsRetrievalConfig=" + connectionIdsRetrievalConfig + >>>>>>> ", pingConfig=" + pingConfig + ", connectionIdsRetrievalConfig=" + connectionIdsRetrievalConfig +
<<<<<<< thing.getMetadata().ifPresent(result::setMetadata); ======= thing.getCreated().ifPresent(result::setCreated); >>>>>>> thing.getCreated().ifPresent(result::setCreated); thing.getMetadata().ifPresent(result::setMetadata); <<<<<<< jsonObject.getValue(Thing.JsonFields.METADATA) .map(ThingsModelFactory::newMetadata) .ifPresent(result::setMetadata); ======= jsonObject.getValue(Thing.JsonFields.CREATED) .map(ImmutableThingFromCopyBuilder::tryToParseCreated) .ifPresent(result::setCreated); >>>>>>> jsonObject.getValue(Thing.JsonFields.CREATED) .map(ImmutableThingFromCopyBuilder::tryToParseCreated) .ifPresent(result::setCreated); jsonObject.getValue(Thing.JsonFields.METADATA) .map(ThingsModelFactory::newMetadata) .ifPresent(result::setMetadata); <<<<<<< public FromCopy setMetadata(@Nullable final Metadata metadata) { fromScratchBuilder.setMetadata(metadata); return this; } @Override ======= public FromCopy setCreated(@Nullable final Instant created) { fromScratchBuilder.setCreated(created); return this; } @Override public FromCopy setCreated(final Predicate<Instant> existingCreatedPredicate, @Nullable final Instant created) { if (existingCreatedPredicate.test(fromScratchBuilder.created)) { setCreated(created); } return this; } @Override >>>>>>> public FromCopy setCreated(@Nullable final Instant created) { fromScratchBuilder.setCreated(created); return this; } @Override public FromCopy setCreated(final Predicate<Instant> existingCreatedPredicate, @Nullable final Instant created) { if (existingCreatedPredicate.test(fromScratchBuilder.created)) { setCreated(created); } return this; } @Override public FromCopy setMetadata(@Nullable final Metadata metadata) { fromScratchBuilder.setMetadata(metadata); return this; } @Override public FromCopy setMetadata(final Predicate<Metadata> existingMetadataPredicate, @Nullable final Metadata metadata) { if (existingMetadataPredicate.test(fromScratchBuilder.metadata)) { setMetadata(metadata); } return this; } @Override
<<<<<<< import org.eclipse.ditto.services.connectivity.messaging.monitoring.logs.ConnectionLogger; import org.eclipse.ditto.services.connectivity.messaging.monitoring.logs.ConnectionLoggerRegistry; import org.eclipse.ditto.services.connectivity.messaging.monitoring.logs.InfoProviderFactory; import org.eclipse.ditto.services.connectivity.messaging.monitoring.metrics.ConnectivityCounterRegistry; import org.eclipse.ditto.services.connectivity.util.ConfigKeys; import org.eclipse.ditto.services.connectivity.util.ConnectionLogUtil; import org.eclipse.ditto.services.connectivity.util.MonitoringConfigReader; ======= import org.eclipse.ditto.services.connectivity.messaging.metrics.ConnectivityCounterRegistry; >>>>>>> import org.eclipse.ditto.services.connectivity.messaging.monitoring.logs.ConnectionLogger; import org.eclipse.ditto.services.connectivity.messaging.monitoring.logs.ConnectionLoggerRegistry; import org.eclipse.ditto.services.connectivity.messaging.monitoring.logs.InfoProviderFactory; import org.eclipse.ditto.services.connectivity.messaging.monitoring.metrics.ConnectivityCounterRegistry; import org.eclipse.ditto.services.connectivity.util.ConnectionLogUtil; <<<<<<< import akka.routing.DefaultResizer; import akka.routing.Resizer; import akka.routing.RoundRobinPool; ======= import akka.routing.ConsistentHashingPool; import akka.routing.ConsistentHashingRouter; import scala.concurrent.duration.Duration; import scala.concurrent.duration.FiniteDuration; >>>>>>> import akka.routing.ConsistentHashingPool; import akka.routing.ConsistentHashingRouter; <<<<<<< protected final ConnectionLogger connectionLogger; ======= protected final ConnectivityConfig connectivityConfig; private final ProtocolAdapterProvider protocolAdapterProvider; >>>>>>> protected final ConnectionLogger connectionLogger; protected final ConnectivityConfig connectivityConfig; private final ProtocolAdapterProvider protocolAdapterProvider; <<<<<<< final Duration initTimeout = config.getDuration(ConfigKeys.Client.INIT_TIMEOUT); final Duration connectingTimeout = Duration.ofSeconds(CONNECTING_TIMEOUT); ======= >>>>>>> <<<<<<< ======= * Transforms a List of CompletableFutures to a CompletableFuture of a List. * * @param futures the stream of futures * @param <T> the type of the CompletableFuture and the List elements * @return the CompletableFuture of a List */ protected static <T> CompletableFuture<List<T>> collectAsList(final Stream<CompletionStage<T>> futures) { final CompletableFuture<T>[] futureArray = futures.map(CompletionStage::toCompletableFuture) .toArray((IntFunction<CompletableFuture<T>[]>) CompletableFuture[]::new); return CompletableFuture.allOf(futureArray).thenApply(aVoid -> Arrays.stream(futureArray) .map(CompletableFuture::join) .collect(Collectors.toList())); } /** >>>>>>> <<<<<<< ConnectionLogUtil.enhanceLogWithCorrelationIdAndConnectionId(log, command, command.getConnectionId()); ======= LogUtil.enhanceLogWithCorrelationId(log, command); >>>>>>> ConnectionLogUtil.enhanceLogWithCorrelationIdAndConnectionId(log, command, command.getConnectionId()); <<<<<<< final RetrieveConnectionMetrics command) { ======= final RetrieveConnectionMetrics command, final BaseClientData data) { >>>>>>> final RetrieveConnectionMetrics command) {
<<<<<<< import org.eclipse.ditto.services.gateway.endpoints.routes.devops.DevOpsRoute; import org.eclipse.ditto.services.gateway.endpoints.routes.health.CachingHealthRoute; import org.eclipse.ditto.services.gateway.endpoints.routes.policies.PoliciesRoute; import org.eclipse.ditto.services.gateway.endpoints.routes.sse.SseThingsRoute; import org.eclipse.ditto.services.gateway.endpoints.routes.stats.StatsRoute; import org.eclipse.ditto.services.gateway.endpoints.routes.status.OverallStatusRoute; import org.eclipse.ditto.services.gateway.endpoints.routes.things.ThingsRoute; import org.eclipse.ditto.services.gateway.endpoints.routes.thingsearch.ThingSearchRoute; import org.eclipse.ditto.services.gateway.endpoints.routes.websocket.WebsocketRoute; import org.eclipse.ditto.services.gateway.endpoints.utils.HttpClientFacade; import org.eclipse.ditto.services.gateway.health.DittoStatusAndHealthProviderFactory; import org.eclipse.ditto.services.gateway.health.StatusAndHealthProvider; import org.eclipse.ditto.services.gateway.health.config.HealthCheckConfig; ======= import org.eclipse.ditto.services.gateway.endpoints.routes.RouteFactory; import org.eclipse.ditto.services.gateway.health.GatewayHttpReadinessCheck; >>>>>>> import org.eclipse.ditto.services.gateway.endpoints.routes.devops.DevOpsRoute; import org.eclipse.ditto.services.gateway.endpoints.routes.health.CachingHealthRoute; import org.eclipse.ditto.services.gateway.endpoints.routes.policies.PoliciesRoute; import org.eclipse.ditto.services.gateway.endpoints.routes.sse.SseThingsRoute; import org.eclipse.ditto.services.gateway.endpoints.routes.stats.StatsRoute; import org.eclipse.ditto.services.gateway.endpoints.routes.status.OverallStatusRoute; import org.eclipse.ditto.services.gateway.endpoints.routes.things.ThingsRoute; import org.eclipse.ditto.services.gateway.endpoints.routes.thingsearch.ThingSearchRoute; import org.eclipse.ditto.services.gateway.endpoints.routes.websocket.WebsocketRoute; import org.eclipse.ditto.services.gateway.endpoints.utils.HttpClientFacade; import org.eclipse.ditto.services.gateway.health.DittoStatusAndHealthProviderFactory; import org.eclipse.ditto.services.gateway.health.StatusAndHealthProvider; import org.eclipse.ditto.services.gateway.health.config.HealthCheckConfig; import org.eclipse.ditto.services.gateway.health.GatewayHttpReadinessCheck; <<<<<<< import org.eclipse.ditto.services.gateway.starter.config.GatewayConfig; ======= import org.eclipse.ditto.services.gateway.starter.service.util.ConfigKeys; import org.eclipse.ditto.services.gateway.starter.service.util.DefaultHttpClientFacade; import org.eclipse.ditto.services.gateway.starter.service.util.HttpClientFacade; >>>>>>> import org.eclipse.ditto.services.gateway.starter.config.GatewayConfig; <<<<<<< private static final String CHILD_RESTART_INFO_MSG = "Restarting child ..."; ======= private static final String AUTHENTICATION_DISPATCHER_NAME = "authentication-dispatcher"; private static final String CHILD_RESTART_INFO_MSG = "Restarting child..."; >>>>>>> private static final String AUTHENTICATION_DISPATCHER_NAME = "authentication-dispatcher"; private static final String CHILD_RESTART_INFO_MSG = "Restarting child ..."; <<<<<<< private GatewayRootActor(final GatewayConfig gatewayConfig, final ActorRef pubSubMediator, ======= private final CompletionStage<ServerBinding> httpBinding; private GatewayRootActor(final ServiceConfigReader configReader, final ActorRef pubSubMediator, >>>>>>> private final CompletionStage<ServerBinding> httpBinding; private GatewayRootActor(final GatewayConfig gatewayConfig, final ActorRef pubSubMediator, <<<<<<< final CompletionStage<ServerBinding> binding = Http.get(actorSystem) .bindAndHandle(createRoute(actorSystem, gatewayConfig, proxyActor, streamingActor, healthCheckActor, healthCheckConfig).flow(actorSystem, materializer), ======= httpBinding = Http.get(actorSystem) .bindAndHandle(createRoute(actorSystem, config, proxyActor, streamingActor, healthCheckActor) .flow(actorSystem, materializer), >>>>>>> httpBinding = Http.get(actorSystem) .bindAndHandle(createRoute(actorSystem, gatewayConfig, proxyActor, streamingActor, healthCheckActor, healthCheckConfig).flow(actorSystem, materializer), <<<<<<< binding.thenAccept(theBinding -> { log.info("Serving HTTP requests on port <{}> ...", theBinding.localAddress().getPort()); ======= httpBinding.thenAccept(theBinding -> { log.info("Serving HTTP requests on port {} ...", theBinding.localAddress().getPort()); >>>>>>> httpBinding.thenAccept(theBinding -> { log.info("Serving HTTP requests on port <{}> ...", theBinding.localAddress().getPort()); <<<<<<< final ActorRef healthCheckingActor, final HealthCheckConfig healthCheckConfig) { final AuthenticationConfig authConfig = gatewayConfig.getAuthenticationConfig(); final HttpClientFacade httpClient = HttpClientFacade.getInstance(actorSystem, authConfig.getHttpProxyConfig()); final Supplier<ClusterStatus> clusterStateSupplier = new ClusterStatusSupplier(Cluster.get(actorSystem)); final CachesConfig cachesConfig = gatewayConfig.getCachesConfig(); final GatewayAuthenticationDirectiveFactory authenticationDirectiveFactory = new DittoGatewayAuthenticationDirectiveFactory(authConfig, cachesConfig.getPublicKeysConfig(), httpClient); final ProtocolAdapterProvider protocolAdapterProvider = ProtocolAdapterProvider.load(gatewayConfig.getProtocolConfig(), actorSystem); final HeaderTranslator headerTranslator = protocolAdapterProvider.getHttpHeaderTranslator(); final WebSocketConfig webSocketConfig = gatewayConfig.getWebSocketConfig(); final StatusAndHealthProvider statusAndHealthProvider = DittoStatusAndHealthProviderFactory.of(actorSystem, clusterStateSupplier, healthCheckConfig); final HttpConfig httpConfig = gatewayConfig.getHttpConfig(); final DevOpsConfig devOpsConfig = authConfig.getDevOpsConfig(); return RootRoute.getBuilder(httpConfig) .statsRoute(new StatsRoute(proxyActor, actorSystem, httpConfig, devOpsConfig, headerTranslator)) .statusRoute(new StatusRoute(clusterStateSupplier, healthCheckingActor, actorSystem)) .overallStatusRoute(new OverallStatusRoute(clusterStateSupplier, statusAndHealthProvider, devOpsConfig)) .cachingHealthRoute( new CachingHealthRoute(statusAndHealthProvider, gatewayConfig.getPublicHealthConfig())) .devopsRoute(new DevOpsRoute(proxyActor, actorSystem, httpConfig, devOpsConfig, headerTranslator)) .policiesRoute(new PoliciesRoute(proxyActor, actorSystem, httpConfig, headerTranslator)) .sseThingsRoute( new SseThingsRoute(proxyActor, actorSystem, httpConfig, streamingActor, headerTranslator)) .thingsRoute(new ThingsRoute(proxyActor, actorSystem, gatewayConfig.getMessageConfig(), gatewayConfig.getClaimMessageConfig(), httpConfig, headerTranslator)) .thingSearchRoute(new ThingSearchRoute(proxyActor, actorSystem, httpConfig, headerTranslator)) .websocketRoute(new WebsocketRoute(streamingActor, webSocketConfig, actorSystem.eventStream())) .supportedSchemaVersions(httpConfig.getSupportedSchemaVersions()) .protocolAdapterProvider(protocolAdapterProvider) .headerTranslator(headerTranslator) .httpAuthenticationDirective(authenticationDirectiveFactory.buildHttpAuthentication()) .wsAuthenticationDirective(authenticationDirectiveFactory.buildWsAuthentication()) ======= final ActorRef healthCheckingActor) { final HttpClientFacade httpClient = DefaultHttpClientFacade.getInstance(actorSystem); final ClusterStatusSupplier clusterStateSupplier = new ClusterStatusSupplier(Cluster.get(actorSystem)); final MessageDispatcher authenticationDispatcher = actorSystem.dispatchers().lookup( AUTHENTICATION_DISPATCHER_NAME); final DittoGatewayAuthenticationDirectiveFactory authenticationDirectiveFactory = new DittoGatewayAuthenticationDirectiveFactory(config, httpClient, authenticationDispatcher); final RouteFactory routeFactory = RouteFactory.newInstance(actorSystem, proxyActor, streamingActor, healthCheckingActor, clusterStateSupplier, authenticationDirectiveFactory); return RootRoute.getBuilder() .statsRoute(routeFactory.newStatsRoute()) .statusRoute(routeFactory.newStatusRoute()) .overallStatusRoute(routeFactory.newOverallStatusRoute()) .cachingHealthRoute(routeFactory.newCachingHealthRoute()) .devopsRoute(routeFactory.newDevopsRoute()) .policiesRoute(routeFactory.newPoliciesRoute()) .sseThingsRoute(routeFactory.newSseThingsRoute()) .thingsRoute(routeFactory.newThingsRoute()) .thingSearchRoute(routeFactory.newThingSearchRoute()) .websocketRoute(routeFactory.newWebSocketRoute()) .supportedSchemaVersions(config.getIntList(ConfigKeys.SCHEMA_VERSIONS)) .protocolAdapterProvider(routeFactory.getProtocolAdapterProvider()) .headerTranslator(routeFactory.getHeaderTranslator()) .httpAuthenticationDirective(routeFactory.newHttpAuthenticationDirective()) .wsAuthenticationDirective(routeFactory.newWsAuthenticationDirective()) >>>>>>> final ActorRef healthCheckingActor, final HealthCheckConfig healthCheckConfig) { final AuthenticationConfig authConfig = gatewayConfig.getAuthenticationConfig(); final CachesConfig cachesConfig = gatewayConfig.getCachesConfig(); final HttpClientFacade httpClient = HttpClientFacade.getInstance(actorSystem, authConfig.getHttpProxyConfig()); final MessageDispatcher authenticationDispatcher = actorSystem.dispatchers().lookup( AUTHENTICATION_DISPATCHER_NAME); final GatewayAuthenticationDirectiveFactory authenticationDirectiveFactory = new DittoGatewayAuthenticationDirectiveFactory(authConfig, cachesConfig.getPublicKeysConfig(), httpClient, authenticationDispatcher); final ProtocolAdapterProvider protocolAdapterProvider = ProtocolAdapterProvider.load(gatewayConfig.getProtocolConfig(), actorSystem); final HeaderTranslator headerTranslator = protocolAdapterProvider.getHttpHeaderTranslator(); final WebSocketConfig webSocketConfig = gatewayConfig.getWebSocketConfig(); final Supplier<ClusterStatus> clusterStateSupplier = new ClusterStatusSupplier(Cluster.get(actorSystem)); final StatusAndHealthProvider statusAndHealthProvider = DittoStatusAndHealthProviderFactory.of(actorSystem, clusterStateSupplier, healthCheckConfig); final HttpConfig httpConfig = gatewayConfig.getHttpConfig(); final DevOpsConfig devOpsConfig = authConfig.getDevOpsConfig(); return RootRoute.getBuilder(httpConfig) .statsRoute(new StatsRoute(proxyActor, actorSystem, httpConfig, devOpsConfig, headerTranslator)) .statusRoute(new StatusRoute(clusterStateSupplier, healthCheckingActor, actorSystem)) .overallStatusRoute(new OverallStatusRoute(clusterStateSupplier, statusAndHealthProvider, devOpsConfig)) .cachingHealthRoute( new CachingHealthRoute(statusAndHealthProvider, gatewayConfig.getPublicHealthConfig())) .devopsRoute(new DevOpsRoute(proxyActor, actorSystem, httpConfig, devOpsConfig, headerTranslator)) .policiesRoute(new PoliciesRoute(proxyActor, actorSystem, httpConfig, headerTranslator)) .sseThingsRoute( new SseThingsRoute(proxyActor, actorSystem, httpConfig, streamingActor, headerTranslator)) .thingsRoute(new ThingsRoute(proxyActor, actorSystem, gatewayConfig.getMessageConfig(), gatewayConfig.getClaimMessageConfig(), httpConfig, headerTranslator)) .thingSearchRoute(new ThingSearchRoute(proxyActor, actorSystem, httpConfig, headerTranslator)) .websocketRoute(new WebsocketRoute(streamingActor, webSocketConfig, actorSystem.eventStream())) .supportedSchemaVersions(httpConfig.getSupportedSchemaVersions()) .protocolAdapterProvider(protocolAdapterProvider) .headerTranslator(headerTranslator) .httpAuthenticationDirective(authenticationDirectiveFactory.buildHttpAuthentication()) .wsAuthenticationDirective(authenticationDirectiveFactory.buildWsAuthentication())
<<<<<<< /** */ @Test public void buildThingSearchCommandTopicPath() { final TopicPath expected = ImmutableTopicPath .of("_", "_", TopicPath.Group.THINGS, TopicPath.Channel.TWIN, TopicPath.Criterion.SEARCH, TopicPath.SearchAction.SUBSCRIBE); final TopicPath actual = ProtocolFactory.newTopicPathBuilderFromNamespace("_") // .things() .twin() // .search() .subscribe() .build(); final String expectedTopicPathString = "_/_/things/twin/search/subscribe"; assertThat(actual).isEqualTo(expected); assertThat(actual.getPath()).isEqualTo(expectedTopicPathString); } ======= @Test public void buildPolicyModifyCommandTopicPath() { final TopicPath expected = ImmutableTopicPath .of("org.eclipse.ditto.test", "myPolicy", TopicPath.Group.POLICIES, TopicPath.Channel.NONE, TopicPath.Criterion.COMMANDS, TopicPath.Action.MODIFY); final TopicPath actual = ProtocolFactory.newTopicPathBuilder(PolicyId.of("org.eclipse.ditto.test", "myPolicy")) .commands() .modify() .build(); final String expectedTopicPathString = "org.eclipse.ditto.test/myPolicy/policies/commands/modify"; assertThat(actual).isEqualTo(expected); assertThat(actual.getPath()).isEqualTo(expectedTopicPathString); } @Test public void buildPolicyModifyCommandTopicPathWitNoneChannel() { final TopicPath expected = ImmutableTopicPath .of("org.eclipse.ditto.test", "myPolicy", TopicPath.Group.POLICIES, TopicPath.Channel.NONE, TopicPath.Criterion.COMMANDS, TopicPath.Action.MODIFY); final TopicPath actual = ProtocolFactory.newTopicPathBuilder(PolicyId.of("org.eclipse.ditto.test", "myPolicy")) .none() .commands() .modify() .build(); final String expectedTopicPathString = "org.eclipse.ditto.test/myPolicy/policies/commands/modify"; assertThat(actual).isEqualTo(expected); assertThat(actual.getPath()).isEqualTo(expectedTopicPathString); } >>>>>>> @Test public void buildPolicyModifyCommandTopicPath() { final TopicPath expected = ImmutableTopicPath .of("org.eclipse.ditto.test", "myPolicy", TopicPath.Group.POLICIES, TopicPath.Channel.NONE, TopicPath.Criterion.COMMANDS, TopicPath.Action.MODIFY); final TopicPath actual = ProtocolFactory.newTopicPathBuilder(PolicyId.of("org.eclipse.ditto.test", "myPolicy")) .commands() .modify() .build(); final String expectedTopicPathString = "org.eclipse.ditto.test/myPolicy/policies/commands/modify"; assertThat(actual).isEqualTo(expected); assertThat(actual.getPath()).isEqualTo(expectedTopicPathString); } @Test public void buildPolicyModifyCommandTopicPathWitNoneChannel() { final TopicPath expected = ImmutableTopicPath .of("org.eclipse.ditto.test", "myPolicy", TopicPath.Group.POLICIES, TopicPath.Channel.NONE, TopicPath.Criterion.COMMANDS, TopicPath.Action.MODIFY); final TopicPath actual = ProtocolFactory.newTopicPathBuilder(PolicyId.of("org.eclipse.ditto.test", "myPolicy")) .none() .commands() .modify() .build(); final String expectedTopicPathString = "org.eclipse.ditto.test/myPolicy/policies/commands/modify"; assertThat(actual).isEqualTo(expected); assertThat(actual.getPath()).isEqualTo(expectedTopicPathString); } /** */ @Test public void buildThingSearchCommandTopicPath() { final TopicPath expected = ImmutableTopicPath .of("_", "_", TopicPath.Group.THINGS, TopicPath.Channel.TWIN, TopicPath.Criterion.SEARCH, TopicPath.SearchAction.SUBSCRIBE); final TopicPath actual = ProtocolFactory.newTopicPathBuilderFromNamespace("_") // .things() .twin() // .search() .subscribe() .build(); final String expectedTopicPathString = "_/_/things/twin/search/subscribe"; assertThat(actual).isEqualTo(expected); assertThat(actual.getPath()).isEqualTo(expectedTopicPathString); }
<<<<<<< import org.eclipse.ditto.services.connectivity.util.ConnectionLogUtil; import org.eclipse.ditto.services.utils.config.ConfigUtil; ======= import org.eclipse.ditto.services.utils.akka.LogUtil; import org.eclipse.ditto.services.utils.config.InstanceIdentifierSupplier; >>>>>>> import org.eclipse.ditto.services.connectivity.util.ConnectionLogUtil; import org.eclipse.ditto.services.utils.config.InstanceIdentifierSupplier;
<<<<<<< final List<String> parameters = new ArrayList<>(getAmqpParameters(username == null || password == null, specificConfig)); final boolean isSecuredConnectionWithAcceptInvalidCertificates = isSecuredConnection(connection) && !connection.isValidateCertificates(); parameters.addAll(getTransportParameters(isSecuredConnectionWithAcceptInvalidCertificates, specificConfig)); ======= final boolean anonymous = username == null || username.isEmpty() || password == null || password.isEmpty(); final List<String> parameters = new ArrayList<>(getAmqpParameters(anonymous, specificConfig)); final boolean securedConnection = !connection.isValidateCertificates() && SECURE_AMQP_SCHEME.equalsIgnoreCase(protocol); parameters.addAll(getTransportParameters(securedConnection, specificConfig)); >>>>>>> final boolean anonymous = username == null || username.isEmpty() || password == null || password.isEmpty(); final List<String> parameters = new ArrayList<>(getAmqpParameters(anonymous, specificConfig)); final boolean isSecuredConnectionWithAcceptInvalidCertificates = isSecuredConnection(connection) && !connection.isValidateCertificates(); parameters.addAll(getTransportParameters(isSecuredConnectionWithAcceptInvalidCertificates, specificConfig));
<<<<<<< import org.eclipse.ditto.services.base.KamonMongoDbMetricsStarter; ======= import org.eclipse.ditto.services.base.config.DittoServiceConfigReader; import org.eclipse.ditto.services.base.config.ServiceConfigReader; import org.eclipse.ditto.services.base.metrics.MongoDbMetricRegistryFactory; import org.eclipse.ditto.services.base.metrics.StatsdMetricsReporter; import org.eclipse.ditto.services.base.metrics.StatsdMetricsStarter; >>>>>>> import org.eclipse.ditto.services.base.config.DittoServiceConfigReader; import org.eclipse.ditto.services.base.config.ServiceConfigReader; <<<<<<< private static final BaseConfigKeys CONFIG_KEYS = BaseConfigKeys.getBuilder() .put(BaseConfigKey.Cluster.MAJORITY_CHECK_ENABLED, ConfigKeys.Cluster.MAJORITY_CHECK_ENABLED) .put(BaseConfigKey.Cluster.MAJORITY_CHECK_DELAY, ConfigKeys.Cluster.MAJORITY_CHECK_DELAY) .put(BaseConfigKey.Metrics.SYSTEM_METRICS_ENABLED, ConfigKeys.Metrics.SYSTEM_METRICS_ENABLED) .put(BaseConfigKey.Metrics.PROMETHEUS_ENABLED, ConfigKeys.Metrics.PROMETHEUS_ENABLED) .put(BaseConfigKey.Metrics.JAEGER_ENABLED, ConfigKeys.Metrics.JAEGER_ENABLED) .build(); private final Logger logger; ======= >>>>>>> <<<<<<< protected void startKamonMetricsReporter(final ActorSystem actorSystem, final Config config) { KamonMongoDbMetricsStarter.newInstance(config, actorSystem, SERVICE_NAME, logger).run(); ======= protected void startStatsdMetricsReporter(final ActorSystem actorSystem, final ServiceConfigReader configReader) { final Map.Entry<String, MetricRegistry> mongoDbMetrics = MongoDbMetricRegistryFactory.createOrGet(actorSystem, configReader.getRawConfig()); StatsdMetricsReporter.getInstance().add(mongoDbMetrics); StatsdMetricsStarter.newInstance(configReader, actorSystem, SERVICE_NAME).run(); >>>>>>> protected void startKamonMetricsReporter(final ActorSystem actorSystem, final ServiceConfigReader configReader) { KamonMetrics.addMetricRegistry(MetricRegistryFactory.mongoDb(actorSystem, configReader.getRawConfig())); KamonMetrics.start(SERVICE_NAME);
<<<<<<< /** * Disable logging for 1 test to hide stacktrace or other logs on level ERROR. Comment out to debug the test. */ public static void disableLogging(final ActorSystem system) { system.eventStream().setLogLevel(Logging.levelFor("off").get().asInt()); } ======= public static HeaderMapping HEADER_MAPPING; static { final HashMap<String, String> map = new HashMap<>(); map.put("eclipse", "ditto"); map.put("thing_id", "{{ thing:id }}"); map.put("device_id", "{{ header:device_id }}"); map.put("prefixed_thing_id", "some.prefix.{{ thing:id }}"); map.put("suffixed_thing_id", "{{ header:device_id }}.some.suffix"); HEADER_MAPPING = ConnectivityModelFactory.newHeaderMapping(map); } >>>>>>> /** * Disable logging for 1 test to hide stacktrace or other logs on level ERROR. Comment out to debug the test. */ public static void disableLogging(final ActorSystem system) { system.eventStream().setLogLevel(Logging.levelFor("off").get().asInt()); } public static HeaderMapping HEADER_MAPPING; static { final HashMap<String, String> map = new HashMap<>(); map.put("eclipse", "ditto"); map.put("thing_id", "{{ thing:id }}"); map.put("device_id", "{{ header:device_id }}"); map.put("prefixed_thing_id", "some.prefix.{{ thing:id }}"); map.put("suffixed_thing_id", "{{ header:device_id }}.some.suffix"); HEADER_MAPPING = ConnectivityModelFactory.newHeaderMapping(map); }
<<<<<<< ======= import java.util.Collections; import java.util.EnumSet; import java.util.LinkedHashSet; import java.util.List; >>>>>>> import java.util.Collections; import java.util.EnumSet; import java.util.LinkedHashSet; import java.util.List; <<<<<<< private final Set<String> additionalAcceptedMediaTypes; ======= private final Set<HeaderDefinition> queryParamsAsHeaders; >>>>>>> private final Set<String> additionalAcceptedMediaTypes; private final Set<HeaderDefinition> queryParamsAsHeaders; <<<<<<< schemaVersions = Set.copyOf(scopedConfig.getIntList(GatewayHttpConfigValue.SCHEMA_VERSIONS.getConfigPath())); ======= schemaVersions = Collections.unmodifiableSet(getJsonSchemaVersions(scopedConfig)); >>>>>>> schemaVersions = Collections.unmodifiableSet(getJsonSchemaVersions(scopedConfig)); <<<<<<< this.additionalAcceptedMediaTypes = Set.of(scopedConfig.getString(GatewayHttpConfigValue.ADDITIONAL_ACCEPTED_MEDIA_TYPES.getConfigPath()) .split(",")); ======= queryParamsAsHeaders = Collections.unmodifiableSet(getQueryParameterNamesAsHeaderDefinitions(scopedConfig)); >>>>>>> queryParamsAsHeaders = Collections.unmodifiableSet(getQueryParameterNamesAsHeaderDefinitions(scopedConfig)); additionalAcceptedMediaTypes = Set.of(scopedConfig.getString(GatewayHttpConfigValue.ADDITIONAL_ACCEPTED_MEDIA_TYPES.getConfigPath()) .split(",")); <<<<<<< @Override public Set<String> getAdditionalAcceptedMediaTypes() { return additionalAcceptedMediaTypes; } ======= @Override public Set<HeaderDefinition> getQueryParametersAsHeaders() { return queryParamsAsHeaders; } >>>>>>> @Override public Set<HeaderDefinition> getQueryParametersAsHeaders() { return queryParamsAsHeaders; } @Override public Set<String> getAdditionalAcceptedMediaTypes() { return additionalAcceptedMediaTypes; } <<<<<<< actorPropsFactoryFullQualifiedClassname.equals(that.actorPropsFactoryFullQualifiedClassname) && additionalAcceptedMediaTypes.equals(that.additionalAcceptedMediaTypes); ======= actorPropsFactoryFullQualifiedClassname.equals(that.actorPropsFactoryFullQualifiedClassname) && queryParamsAsHeaders.equals(that.queryParamsAsHeaders); >>>>>>> actorPropsFactoryFullQualifiedClassname.equals(that.actorPropsFactoryFullQualifiedClassname) && queryParamsAsHeaders.equals(that.queryParamsAsHeaders) && additionalAcceptedMediaTypes.equals(that.additionalAcceptedMediaTypes); <<<<<<< redirectToHttpsBlacklistPattern, enableCors, requestTimeout, actorPropsFactoryFullQualifiedClassname, additionalAcceptedMediaTypes); ======= redirectToHttpsBlacklistPattern, enableCors, requestTimeout, actorPropsFactoryFullQualifiedClassname, queryParamsAsHeaders); >>>>>>> redirectToHttpsBlacklistPattern, enableCors, requestTimeout, actorPropsFactoryFullQualifiedClassname, queryParamsAsHeaders, additionalAcceptedMediaTypes); <<<<<<< ", additionalAcceptedMediaTypes=" + additionalAcceptedMediaTypes + ======= ", queryParamsAsHeaders=" + queryParamsAsHeaders + >>>>>>> ", queryParamsAsHeaders=" + queryParamsAsHeaders + ", additionalAcceptedMediaTypes=" + additionalAcceptedMediaTypes +
<<<<<<< ======= private void respondWithCreateConnectionResponse(final Connection connection, final CreateConnection command, final ActorRef origin) { origin.tell(CreateConnectionResponse.of(connection, command.getDittoHeaders()), getSelf()); getContext().getParent().tell(ConnectionSupervisorActor.ManualReset.getInstance(), getSelf()); } private boolean isConnectionConfigurationValid(final Connection connection, final ActorRef origin) { try { // try to create actor props before persisting the connection to fail early propsFactory.getActorPropsForType(connection, conciergeForwarder); return true; } catch (final Exception e) { handleException("connect", origin, e); stopSelf(); return false; } } >>>>>>> private void respondWithCreateConnectionResponse(final Connection connection, final CreateConnection command, final ActorRef origin) { origin.tell(CreateConnectionResponse.of(connection, command.getDittoHeaders()), getSelf()); getContext().getParent().tell(ConnectionSupervisorActor.ManualReset.getInstance(), getSelf()); }
<<<<<<< import org.eclipse.ditto.model.base.auth.AuthorizationContext; import org.eclipse.ditto.model.base.exceptions.DittoRuntimeException; import org.eclipse.ditto.model.base.headers.DittoHeaders; ======= import org.eclipse.ditto.model.base.exceptions.DittoRuntimeException; import org.eclipse.ditto.model.base.headers.DittoHeaders; >>>>>>> import org.eclipse.ditto.model.base.auth.AuthorizationContext; import org.eclipse.ditto.model.base.exceptions.DittoRuntimeException; import org.eclipse.ditto.model.base.headers.DittoHeaders; <<<<<<< import org.eclipse.ditto.signals.base.Signal; import org.eclipse.ditto.signals.commands.base.Command; ======= import org.eclipse.ditto.signals.commands.base.Command; >>>>>>> import org.eclipse.ditto.signals.base.Signal; import org.eclipse.ditto.signals.commands.base.Command; <<<<<<< @Nullable private String connectionStatusDetails; private Set<String> uniqueTopicPaths; ======= >>>>>>> private Set<String> uniqueTopicPaths; <<<<<<< .match(Signal.class, this::handleSignal) ======= .match(RetrieveConnectionMetrics.class, this::retrieveConnectionMetrics) .match(ThingEvent.class, this::handleThingEvent) >>>>>>> .match(RetrieveConnectionMetrics.class, this::retrieveConnectionMetrics) .match(Signal.class, this::handleSignal) <<<<<<< private boolean isAuthorized(final Signal<?> signal, final AuthorizationContext authorizationContext) { final Set<String> authorizedReadSubjects = signal.getDittoHeaders().getReadSubjects(); final List<String> connectionSubjects = authorizationContext.getAuthorizationSubjectIds(); return !Collections.disjoint(authorizedReadSubjects, connectionSubjects); } ======= private void testConnection(final TestConnection command) { final ActorRef origin = getSender(); connection = command.getConnection(); mappingContexts = command.getMappingContexts(); askClientActor("test", command, origin, response -> { origin.tell( TestConnectionResponse.of(command.getConnectionId(), response.toString(), command.getDittoHeaders()), getSelf()); }); // terminate this actor's supervisor after a connection test again: final ActorRef parent = getContext().getParent(); getContext().getSystem().scheduler().scheduleOnce(FiniteDuration.apply(5, TimeUnit.SECONDS), parent, PoisonPill.getInstance(), getContext().dispatcher(), getSelf()); } >>>>>>> private boolean isAuthorized(final Signal<?> signal, final AuthorizationContext authorizationContext) { final Set<String> authorizedReadSubjects = signal.getDittoHeaders().getReadSubjects(); final List<String> connectionSubjects = authorizationContext.getAuthorizationSubjectIds(); return !Collections.disjoint(authorizedReadSubjects, connectionSubjects); } private void testConnection(final TestConnection command) { final ActorRef origin = getSender(); connection = command.getConnection(); mappingContexts = command.getMappingContexts(); askClientActor("test", command, origin, response -> { origin.tell( TestConnectionResponse.of(command.getConnectionId(), response.toString(), command.getDittoHeaders()), getSelf()); }); // terminate this actor's supervisor after a connection test again: final ActorRef parent = getContext().getParent(); getContext().getSystem().scheduler().scheduleOnce(FiniteDuration.apply(5, TimeUnit.SECONDS), parent, PoisonPill.getInstance(), getContext().dispatcher(), getSelf()); } <<<<<<< unsubscribeFromEvents(); connectionStatusDetails = "closed as requested by CloseConnection command"; ======= unsubscribeFromThingEvents(); >>>>>>> unsubscribeFromEvents(); <<<<<<< private void subscribeForEvents() { checkNotNull(connection, "connection"); uniqueTopicPaths = connection.getTargets().stream() .flatMap(target -> target.getTopics().stream()) .collect(Collectors.toSet()); final Set<String> pubSubTopics = uniqueTopicPaths.stream() .map(TopicPathMapper::mapToPubSubTopic) .filter(Optional::isPresent) .map(Optional::get) .collect(Collectors.toSet()); pubSubTopics.forEach(pubSubTopic -> { ======= private void subscribeToThingEvents() { checkNotNull(connection, "Connection"); if (connection.getEventTarget().isPresent()) { >>>>>>> private void subscribeForEvents() { checkNotNull(connection, "Connection"); uniqueTopicPaths = connection.getTargets().stream() .flatMap(target -> target.getTopics().stream()) .collect(Collectors.toSet()); final Set<String> pubSubTopics = uniqueTopicPaths.stream() .map(TopicPathMapper::mapToPubSubTopic) .filter(Optional::isPresent) .map(Optional::get) .collect(Collectors.toSet()); pubSubTopics.forEach(pubSubTopic -> {
<<<<<<< private final Action action; private final SearchAction searchAction; ======= @Nullable private final Action action; @Nullable private final String subject; >>>>>>> @Nullable private final Action action; @Nullable private final String subject; @Nullable private final SearchAction searchAction; <<<<<<< private final String subject; private ImmutableTopicPath(final String namespace, final String id, final Group group, final Channel channel, final Criterion criterion, final Action action, final SearchAction searchAction, final String subject) { this.namespace = namespace; this.id = id; this.group = group; this.channel = channel; this.criterion = criterion; ======= private ImmutableTopicPath(final String namespace, final String id, final Group group, @Nullable final Channel channel, final Criterion criterion, @Nullable final Action action, @Nullable final String subject) { this.namespace = checkNotNull(namespace, PROP_NAME_NAMESPACE); this.id = checkNotNull(id, PROP_NAME_ID); this.group = checkNotNull(group, PROP_NAME_GROUP); this.channel = checkChannelArgument(channel, group); this.criterion = checkNotNull(criterion, PROP_NAME_CRITERION); >>>>>>> private ImmutableTopicPath(final String namespace, final String id, final Group group, @Nullable final Channel channel, final Criterion criterion, @Nullable final Action action, @Nullable final SearchAction searchAction, @Nullable final String subject) { this.namespace = checkNotNull(namespace, PROP_NAME_NAMESPACE); this.id = checkNotNull(id, PROP_NAME_ID); this.group = checkNotNull(group, PROP_NAME_GROUP); this.channel = checkChannelArgument(channel, group); this.criterion = checkNotNull(criterion, PROP_NAME_CRITERION); <<<<<<< final Channel channel, final Criterion criterion, final Action action) { requireNonNull(namespace, PROP_NAME_NAMESPACE); requireNonNull(id, PROP_NAME_ID); requireNonNull(group, PROP_NAME_GROUP); requireNonNull(channel, PROP_NAME_CHANNEL); requireNonNull(criterion, PROP_NAME_CRITERION); requireNonNull(action, PROP_NAME_ACTION); return new ImmutableTopicPath(namespace, id, group, channel, criterion, action, null, null); } /** * Returns a new ImmutableTopicPath for the specified {@code namespace}, {@code id}, {@code group}, * {@code criterion} and {@code action}. * * @param namespace the namespace. * @param id the id. * @param group the group. * @param channel the channel. * @param criterion the criterion. * @param searchAction the search action. * @return the TopicPath. * @throws NullPointerException if any argument is {@code null}. */ public static ImmutableTopicPath of(final String namespace, final String id, final Group group, final Channel channel, final Criterion criterion, final SearchAction searchAction) { requireNonNull(namespace, PROP_NAME_NAMESPACE); requireNonNull(id, PROP_NAME_ID); requireNonNull(group, PROP_NAME_GROUP); requireNonNull(channel, PROP_NAME_CHANNEL); requireNonNull(criterion, PROP_NAME_CRITERION); requireNonNull(searchAction, PROP_NAME_ACTION); return new ImmutableTopicPath(namespace, id, group, channel, criterion, null, searchAction, null); ======= final Channel channel, final Criterion criterion, final Action action) { checkNotNull(action, "action"); return new ImmutableTopicPath(namespace, id, group, channel, criterion, action, null); >>>>>>> final Channel channel, final Criterion criterion, final Action action) { checkNotNull(action, "action"); return new ImmutableTopicPath(namespace, id, group, channel, criterion, action, null, null); } /** * Returns a new ImmutableTopicPath for the specified {@code namespace}, {@code id}, {@code group}, * {@code criterion} and {@code action} * * @param namespace the namespace. * @param id the id. * @param group the group. * @param channel the channel. * @param criterion the criterion. * @param subject the subject of the path. * @return the TopicPath. * @throws NullPointerException if any argument is {@code null}. */ public static ImmutableTopicPath of(final String namespace, final String id, final Group group, final Channel channel, final Criterion criterion, final String subject) { checkNotNull(subject, "subject"); return new ImmutableTopicPath(namespace, id, group, channel, criterion, null, null, subject); <<<<<<< final Channel channel, final Criterion criterion, final String subject) { requireNonNull(namespace, PROP_NAME_NAMESPACE); requireNonNull(id, PROP_NAME_ID); requireNonNull(group, PROP_NAME_GROUP); requireNonNull(channel, PROP_NAME_CHANNEL); requireNonNull(criterion, PROP_NAME_CRITERION); requireNonNull(subject, PROP_NAME_SUBJECT); return new ImmutableTopicPath(namespace, id, group, channel, criterion, null, null, subject); ======= final Channel channel, final Criterion criterion, final String subject) { checkNotNull(subject, "subject"); return new ImmutableTopicPath(namespace, id, group, channel, criterion, null, subject); >>>>>>> final Channel channel, final Criterion criterion, final String subject) { checkNotNull(subject, "subject"); return new ImmutableTopicPath(namespace, id, group, channel, criterion, null, null, subject); } /** * Returns a new ImmutableTopicPath for the specified {@code namespace}, {@code id}, {@code group}, * {@code criterion} and {@code action} * * @param namespace the namespace. * @param id the id. * @param group the group. * @param channel the channel. * @param criterion the criterion. * @param searchAction the subject of the path. * @return the TopicPath. * @throws NullPointerException if any argument is {@code null}. */ public static ImmutableTopicPath of(final String namespace, final String id, final Group group, final Channel channel, final Criterion criterion, final SearchAction searchAction) { checkNotNull(searchAction, "searchAction"); return new ImmutableTopicPath(namespace, id, group, channel, criterion, null, searchAction, null); <<<<<<< Objects.equals(searchAction, that.searchAction) && Objects.equals(subject, that.subject) && Objects.equals(path, that.path); ======= Objects.equals(subject, that.subject) && Objects.equals(path, that.path); >>>>>>> Objects.equals(searchAction, that.searchAction) && Objects.equals(subject, that.subject) && Objects.equals(path, that.path); <<<<<<< ", channel=" + channel + ", criterion=" + criterion + ", action=" + action + ", searchAction=" + searchAction + ", subject=" + subject + ", path=" + path + ']'; ======= ", channel=" + channel + ", criterion=" + criterion + ", action=" + action + ", subject=" + subject + ", path=" + path + ']'; >>>>>>> ", channel=" + channel + ", criterion=" + criterion + ", action=" + action + ", searchAction=" + searchAction + ", subject=" + subject + ", path=" + path + ']'; <<<<<<< // e.g.: <ns>/<id>/things/live/messages/<msgSubject> return MessageFormat.format("{0}/{1}/{2}/{3}/{4}/{5}", namespace, id, group, channel, criterion, subject); } else if (searchAction != null) { // e.g.: <ns>/<id>/things/live/messages/<msgSubject> return MessageFormat.format("{0}/{1}/{2}/{3}/{4}/{5}", namespace, id, group, channel, criterion, searchAction); } else { // e.g.: <ns>/<id>/things/twin/search return MessageFormat.format("{0}/{1}/{2}/{3}/{4}", namespace, id, group, channel, criterion); ======= // e.g.: <ns>/<id>/things/live/messages/<subject> builder.append(PATH_DELIMITER).append(subject); >>>>>>> // e.g.: <ns>/<id>/things/live/messages/<subject> builder.append(PATH_DELIMITER).append(subject); }else if (searchAction != null) { builder.append(PATH_DELIMITER).append(searchAction);
<<<<<<< import org.eclipse.ditto.services.things.persistence.strategies.ReceiveStrategy; import org.eclipse.ditto.services.things.starter.util.ConfigKeys; ======= >>>>>>> import org.eclipse.ditto.services.things.persistence.strategies.ReceiveStrategy; <<<<<<< import org.eclipse.ditto.services.utils.cleanup.AbstractPersistentActorWithTimersAndCleanup; import org.eclipse.ditto.services.utils.persistence.SnapshotAdapter; ======= import org.eclipse.ditto.services.utils.config.DefaultScopedConfig; import org.eclipse.ditto.services.utils.persistence.mongo.config.ActivityCheckConfig; import org.eclipse.ditto.services.utils.persistence.mongo.config.SnapshotConfig; >>>>>>> import org.eclipse.ditto.services.utils.cleanup.AbstractPersistentActorWithTimersAndCleanup; import org.eclipse.ditto.services.utils.config.DefaultScopedConfig; import org.eclipse.ditto.services.utils.persistence.SnapshotAdapter; import org.eclipse.ditto.services.utils.persistence.mongo.config.ActivityCheckConfig; <<<<<<< import akka.actor.ActorSystem; ======= import akka.actor.Cancellable; >>>>>>> <<<<<<< ======= import akka.event.DiagnosticLoggingAdapter; >>>>>>> import akka.event.DiagnosticLoggingAdapter; <<<<<<< private final SnapshotAdapter<ThingWithSnapshotTag> snapshotAdapter; private final Duration activityCheckInterval; private final Duration activityCheckDeletedInterval; ======= private final ThingSnapshotter<?, ?> thingSnapshotter; private final ThingConfig thingConfig; private final boolean logIncomingMessages; >>>>>>> private final SnapshotAdapter<ThingWithSnapshotTag> snapshotAdapter; <<<<<<< private final long snapshotThreshold; private long lastSnapshotRevision; private long confirmedSnapshotRevision; ======= >>>>>>> private final ThingConfig thingConfig; private final boolean logIncomingMessages; private long lastSnapshotRevision; private long confirmedSnapshotRevision; <<<<<<< ThingPersistenceActor(final String thingId, final ActorRef pubSubMediator, final SnapshotAdapter<ThingWithSnapshotTag> snapshotAdapter) { ======= ThingPersistenceActor(final String thingId, final ActorRef pubSubMediator, final ThingSnapshotter.Create thingSnapshotterCreate) { >>>>>>> ThingPersistenceActor(final String thingId, final ActorRef pubSubMediator, final SnapshotAdapter<ThingWithSnapshotTag> snapshotAdapter) { <<<<<<< public static Props props(final String thingId, final ActorRef pubSubMediator) { return props(thingId, pubSubMediator, new ThingMongoSnapshotAdapter()); ======= static Props props(final String thingId, final ActorRef pubSubMediator) { return Props.create(ThingPersistenceActor.class, thingId, pubSubMediator, (ThingSnapshotter.Create) DittoThingSnapshotter::getInstance); >>>>>>> public static Props props(final String thingId, final ActorRef pubSubMediator) { return props(thingId, pubSubMediator, new ThingMongoSnapshotAdapter()); <<<<<<< private void scheduleCheckForThingActivity(final long intervalInSeconds) { log.debug("Scheduling for Activity Check in <{}> seconds.", intervalInSeconds); final Object message = new CheckForActivity(getRevisionNumber(), accessCounter); timers().startSingleTimer("activityCheck", message, Duration.ofSeconds(intervalInSeconds)); } ======= @Nonnull @Override public Thing getThing() { return thing; } @Nonnull @Override public String getThingId() { return thingId; } >>>>>>> private void scheduleCheckForThingActivity(final java.time.Duration interval) { log.debug("Scheduling for Activity Check in <{}> seconds.", interval); final Object message = new CheckForActivity(getRevisionNumber(), accessCounter); timers().startSingleTimer("activityCheck", message, interval); } <<<<<<< ======= thingSnapshotter.postStop(); if (null != activityChecker) { activityChecker.cancel(); } >>>>>>> <<<<<<< scheduleCheckForThingActivity(activityCheckInterval.getSeconds()); ======= final ActivityCheckConfig activityCheckConfig = thingConfig.getActivityCheckConfig(); scheduleCheckForThingActivity(activityCheckConfig.getInactiveInterval()); thingSnapshotter.startMaintenanceSnapshots(); >>>>>>> scheduleCheckForThingActivity(thingConfig.getActivityCheckConfig().getInactiveInterval()); scheduleSnapshot(); } private void scheduleSnapshot() { final Duration snapshotInterval = thingConfig.getSnapshotConfig().getInterval(); timers().startPeriodicTimer("takeSnapshot", new TakeSnapshot(), snapshotInterval); } private void cancelSnapshot() { timers().cancel("takeSnapshot"); <<<<<<< takeSnapshot("the thing is deleted and has no up-to-date snapshot"); scheduleCheckForThingActivity(activityCheckDeletedInterval.getSeconds()); ======= thingSnapshotter.takeSnapshotInternal(); final ActivityCheckConfig activityCheckConfig = thingConfig.getActivityCheckConfig(); scheduleCheckForThingActivity(activityCheckConfig.getDeletedInterval()); >>>>>>> takeSnapshot("the thing is deleted and has no up-to-date snapshot"); final ActivityCheckConfig activityCheckConfig = thingConfig.getActivityCheckConfig(); scheduleCheckForThingActivity(activityCheckConfig.getDeletedInterval());
<<<<<<< import pl.asie.computronics.api.audio.AudioPacketRegistry; import pl.asie.computronics.audio.SoundCardPacket; import pl.asie.computronics.audio.SoundCardPacketClientHandler; import pl.asie.computronics.audio.SoundCardPlaybackManager; import pl.asie.computronics.client.UpgradeRenderer; ======= >>>>>>> import pl.asie.computronics.api.audio.AudioPacketRegistry; import pl.asie.computronics.audio.SoundCardPacket; import pl.asie.computronics.audio.SoundCardPacketClientHandler; import pl.asie.computronics.audio.SoundCardPlaybackManager; import pl.asie.computronics.client.UpgradeRenderer; <<<<<<< public SoundCardPlaybackManager audio; ======= public static DriverBoardBoom.BoomHandler boomBoardHandler; >>>>>>> public static DriverBoardBoom.BoomHandler boomBoardHandler; public SoundCardPlaybackManager audio; <<<<<<< || Config.OC_CARD_NOISE || Config.OC_CARD_SOUND) { ======= || Config.OC_CARD_NOISE || Config.OC_BOARD_LIGHT || Config.OC_BOARD_BOOM || Config.OC_BOARD_CAPACITOR) { >>>>>>> || Config.OC_CARD_NOISE || Config.OC_CARD_SOUND || Config.OC_BOARD_LIGHT || Config.OC_BOARD_BOOM || Config.OC_BOARD_CAPACITOR) {
<<<<<<< public class ItemOpenComputers extends ItemMultiple implements Item, EnvironmentAware, HostAware, IItemWithDocumentation { ======= public class ItemOpenComputers extends ItemMultiple implements Item, EnvironmentAware, HostAware, UpgradeRenderer { >>>>>>> public class ItemOpenComputers extends ItemMultiple implements Item, EnvironmentAware, HostAware, UpgradeRenderer, IItemWithDocumentation { <<<<<<< @Override public String getDocumentationName(ItemStack stack) { switch(stack.getItemDamage()) { case 0: return "camera_upgrade"; case 1: return "chat_upgrade"; case 2: return "radar_upgrade"; case 3: return "particle_card"; case 4: return "spoofing_card"; case 5: return "beep_card"; case 6: return "self_destructing_card"; default: return "index"; } } ======= @Override @Optional.Method(modid = Mods.OpenComputers) public String computePreferredMountPoint(ItemStack stack, Robot robot, Set<String> availableMountPoints) { return IntegrationOpenComputers.upgradeRenderer.computePreferredMountPoint(stack, robot, availableMountPoints); } @Override @Optional.Method(modid = Mods.OpenComputers) public void render(ItemStack stack, RobotRenderEvent.MountPoint mountPoint, Robot robot, float pt) { IntegrationOpenComputers.upgradeRenderer.render(stack, mountPoint, robot, pt); } >>>>>>> @Override public String getDocumentationName(ItemStack stack) { switch(stack.getItemDamage()) { case 0: return "camera_upgrade"; case 1: return "chat_upgrade"; case 2: return "radar_upgrade"; case 3: return "particle_card"; case 4: return "spoofing_card"; case 5: return "beep_card"; case 6: return "self_destructing_card"; default: return "index"; } } @Override @Optional.Method(modid = Mods.OpenComputers) public String computePreferredMountPoint(ItemStack stack, Robot robot, Set<String> availableMountPoints) { return IntegrationOpenComputers.upgradeRenderer.computePreferredMountPoint(stack, robot, availableMountPoints); } @Override @Optional.Method(modid = Mods.OpenComputers) public void render(ItemStack stack, RobotRenderEvent.MountPoint mountPoint, Robot robot, float pt) { IntegrationOpenComputers.upgradeRenderer.render(stack, mountPoint, robot, pt); }
<<<<<<< for(Channel.WaveEntry entry : channel.entries) { ======= for(int i = 0; i < channel.entries.size(); i++) { ChannelEntry entry = channel.entries.get(i); >>>>>>> for(int i = 0; i < channel.entries.size(); i++) { Channel.WaveEntry entry = channel.entries.get(i); <<<<<<< packet.writeFloat(entry.freqPair.frequency) ======= packet .writeByte((byte) getMode(i).ordinal()) .writeShort((short) entry.freqPair.frequency) >>>>>>> packet .writeByte((byte) getMode(i).ordinal()) .writeFloat(entry.freqPair.frequency) <<<<<<< float frequency = packet.readFloat(); ======= AudioType type = AudioType.fromIndex(packet.readUnsignedByte()); short frequency = packet.readShort(); >>>>>>> AudioType type = AudioType.fromIndex(packet.readUnsignedByte()); float frequency = packet.readFloat();
<<<<<<< public static boolean OC_BOARD_LIGHT; public static boolean OC_BOARD_BOOM; public static boolean OC_BOARD_CAPACITOR; ======= public static boolean OC_CARD_NOISE; >>>>>>> public static boolean OC_CARD_NOISE; public static boolean OC_BOARD_LIGHT; public static boolean OC_BOARD_BOOM; public static boolean OC_BOARD_CAPACITOR; <<<<<<< OC_BOARD_LIGHT = config.get("enable.opencomputers", "lightBoard", true).getBoolean(true); OC_BOARD_BOOM = config.get("enable.opencomputers", "boomBoard", true).getBoolean(true); OC_BOARD_CAPACITOR = config.get("enable.opencomputers", "rackCapacitor", true).getBoolean(true); ======= OC_CARD_NOISE = config.get("enable.opencomputers", "noiseCard", true).getBoolean(true); >>>>>>> OC_CARD_NOISE = config.get("enable.opencomputers", "noiseCard", true).getBoolean(true); OC_BOARD_LIGHT = config.get("enable.opencomputers", "lightBoard", true).getBoolean(true); OC_BOARD_BOOM = config.get("enable.opencomputers", "boomBoard", true).getBoolean(true); OC_BOARD_CAPACITOR = config.get("enable.opencomputers", "rackCapacitor", true).getBoolean(true);
<<<<<<< import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.ModAPIManager; ======= >>>>>>> import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.ModAPIManager; <<<<<<< case 6: { /*if(Mods.API.hasClass("marytts.LocalMaryInterface")){ int dimId = packet.readInt(); int x = packet.readInt(); int y = packet.readInt(); int z = packet.readInt(); int codecId = packet.readInt(); StreamingAudioPlayer codec = Computronics.tts.getPlayer(codecId); if(dimId != WorldUtils.getCurrentClientDimension()) { return; } //Computronics.tts.say(x, y, z, packet.readString()); }*/ }break; ======= case Packets.PACKET_TICKET_SYNC: { if(Mods.isLoaded(Mods.Railcraft)) { Computronics.railcraft.onMessageRailcraft(packet, player, false); } } break; >>>>>>> case Packets.PACKET_TICKET_SYNC: { if(Mods.isLoaded(Mods.Railcraft)) { Computronics.railcraft.onMessageRailcraft(packet, player, false); } } break; case 6: { /*if(Mods.API.hasClass("marytts.LocalMaryInterface")){ int dimId = packet.readInt(); int x = packet.readInt(); int y = packet.readInt(); int z = packet.readInt(); int codecId = packet.readInt(); StreamingAudioPlayer codec = Computronics.tts.getPlayer(codecId); if(dimId != WorldUtils.getCurrentClientDimension()) { return; } //Computronics.tts.say(x, y, z, packet.readString()); }*/ }break;
<<<<<<< import java.util.List; ======= import java.util.HashSet; >>>>>>> import java.util.HashSet; import java.util.List; <<<<<<< import java.util.concurrent.atomic.AtomicInteger; ======= import java.util.Set; >>>>>>> import java.util.Set; import java.util.concurrent.atomic.AtomicInteger;
<<<<<<< this(new HollowFilesystemBlobStager(), publisher, announcer, Collections.<Validator>emptyList(), Collections.<HollowProducerListener>emptyList(), new VersionMinterWithCounter(), null, 0, DEFAULT_TARGET_MAX_TYPE_SHARD_SIZE, new DummyBlobStorageCleaner()); ======= this(new HollowFilesystemBlobStager(), publisher, announcer, Collections.<Validator>emptyList(), Collections.<HollowProducerListener>emptyList(), new VersionMinterWithCounter(), null, 0, DEFAULT_TARGET_MAX_TYPE_SHARD_SIZE, null); >>>>>>> this(new HollowFilesystemBlobStager(), publisher, announcer, Collections.<Validator>emptyList(), Collections.<HollowProducerListener>emptyList(), new VersionMinterWithCounter(), null, 0, DEFAULT_TARGET_MAX_TYPE_SHARD_SIZE, null, new DummyBlobStorageCleaner()); <<<<<<< this(new HollowFilesystemBlobStager(), publisher, announcer, Collections.singletonList(validator), Collections.<HollowProducerListener>emptyList(), new VersionMinterWithCounter(), null, 0, DEFAULT_TARGET_MAX_TYPE_SHARD_SIZE, new DummyBlobStorageCleaner()); ======= this(new HollowFilesystemBlobStager(), publisher, announcer, Collections.singletonList(validator), Collections.<HollowProducerListener>emptyList(), new VersionMinterWithCounter(), null, 0, DEFAULT_TARGET_MAX_TYPE_SHARD_SIZE, null); >>>>>>> this(new HollowFilesystemBlobStager(), publisher, announcer, Collections.singletonList(validator), Collections.<HollowProducerListener>emptyList(), new VersionMinterWithCounter(), null, 0, DEFAULT_TARGET_MAX_TYPE_SHARD_SIZE, null, new DummyBlobStorageCleaner()); <<<<<<< long targetMaxTypeShardSize, BlobStorageCleaner blobStorageCleaner) { ======= long targetMaxTypeShardSize, HollowMetricsCollector<HollowProducerMetrics> metricsCollector) { >>>>>>> long targetMaxTypeShardSize, HollowMetricsCollector<HollowProducerMetrics> metricsCollector, BlobStorageCleaner blobStorageCleaner) { <<<<<<< blobStorageCleaner.clean(blobType); ======= metrics.updateBlobTypeMetrics(builder.build()); if(metricsCollector !=null) metricsCollector.collect(metrics); >>>>>>> metrics.updateBlobTypeMetrics(builder.build()); if(metricsCollector !=null) metricsCollector.collect(metrics); blobStorageCleaner.clean(blobType); <<<<<<< private BlobStager stager; private BlobCompressor compressor; private File stagingDir; private Publisher publisher; private Announcer announcer; private BlobStorageCleaner blobStorageCleaner = new DummyBlobStorageCleaner(); private List<Validator> validators = new ArrayList<Validator>(); private List<HollowProducerListener> listeners = new ArrayList<HollowProducerListener>(); private VersionMinter versionMinter = new VersionMinterWithCounter(); private Executor snapshotPublishExecutor = null; private int numStatesBetweenSnapshots = 0; private long targetMaxTypeShardSize = DEFAULT_TARGET_MAX_TYPE_SHARD_SIZE; ======= protected BlobStager stager; protected BlobCompressor compressor; protected File stagingDir; protected Publisher publisher; protected Announcer announcer; protected List<Validator> validators = new ArrayList<Validator>(); protected List<HollowProducerListener> listeners = new ArrayList<HollowProducerListener>(); protected VersionMinter versionMinter = new VersionMinterWithCounter(); protected Executor snapshotPublishExecutor = null; protected int numStatesBetweenSnapshots = 0; protected long targetMaxTypeShardSize = DEFAULT_TARGET_MAX_TYPE_SHARD_SIZE; protected HollowMetricsCollector<HollowProducerMetrics> metricsCollector; >>>>>>> protected BlobStager stager; protected BlobCompressor compressor; protected File stagingDir; protected Publisher publisher; protected Announcer announcer; protected List<Validator> validators = new ArrayList<Validator>(); protected List<HollowProducerListener> listeners = new ArrayList<HollowProducerListener>(); protected VersionMinter versionMinter = new VersionMinterWithCounter(); protected Executor snapshotPublishExecutor = null; protected int numStatesBetweenSnapshots = 0; protected long targetMaxTypeShardSize = DEFAULT_TARGET_MAX_TYPE_SHARD_SIZE; protected HollowMetricsCollector<HollowProducerMetrics> metricsCollector; protected BlobStorageCleaner blobStorageCleaner = new DummyBlobStorageCleaner(); <<<<<<< public Builder withBlobStorageCleaner(BlobStorageCleaner blobStorageCleaner) { this.blobStorageCleaner = blobStorageCleaner; return this; } public HollowProducer build() { ======= protected void checkArguments() { >>>>>>> public Builder withBlobStorageCleaner(BlobStorageCleaner blobStorageCleaner) { this.blobStorageCleaner = blobStorageCleaner; return this; } protected void checkArguments() { <<<<<<< return new HollowProducer(stager, publisher, announcer, validators, listeners, versionMinter, snapshotPublishExecutor, numStatesBetweenSnapshots, targetMaxTypeShardSize, blobStorageCleaner); } } /** * Provides the opportunity to clean the blob storage. * It allows users to implement logic base on Blob Type. */ public static abstract class BlobStorageCleaner { public void clean(Blob.Type blobType) { switch(blobType) { case SNAPSHOT: cleanSnapshots(); break; case DELTA: cleanDeltas(); break; case REVERSE_DELTA: cleanReverseDeltas(); break; } ======= return new HollowProducer(stager, publisher, announcer, validators, listeners, versionMinter, snapshotPublishExecutor, numStatesBetweenSnapshots, targetMaxTypeShardSize, metricsCollector); >>>>>>> return new HollowProducer(stager, publisher, announcer, validators, listeners, versionMinter, snapshotPublishExecutor, numStatesBetweenSnapshots, targetMaxTypeShardSize, metricsCollector, blobStorageCleaner); } } /** * Provides the opportunity to clean the blob storage. * It allows users to implement logic base on Blob Type. */ public static abstract class BlobStorageCleaner { public void clean(Blob.Type blobType) { switch(blobType) { case SNAPSHOT: cleanSnapshots(); break; case DELTA: cleanDeltas(); break; case REVERSE_DELTA: cleanReverseDeltas(); break; }
<<<<<<< HollowAPIGenerator generator = initGenerator(new HollowAPIGenerator.Builder().withDataModel(writeEngine).withAPIClassname(apiClassName).withPackageName(packageName)); generator.generateFiles(sourceFolder); ======= HollowAPIGenerator generator = initGenerator(new HollowAPIGenerator.Builder().withDataModel(clazz).withAPIClassname(apiClassName).withPackageName(packageName)); generator.generateFiles(sourceFolder + "/" + packageName.replace('.', '/')); >>>>>>> HollowAPIGenerator generator = initGenerator(new HollowAPIGenerator.Builder().withDataModel(clazz).withAPIClassname(apiClassName).withPackageName(packageName)); generator.generateFiles(sourceFolder);
<<<<<<< ======= public Comparator getComparator( Class type ) { return new Comparator() { @Override public int compare(Object o1, Object o2) { return Util.compare(o1, o2); } }; } >>>>>>>
<<<<<<< for (CachedConnection cachedConnection : getCache().get(ttk)) { if (!cachedConnection.isReserved()) { cachedConnection.setReserved(true); final String serverAddr = ttk.getServer().toString(); log.trace("Using existing connection to {}", serverAddr); return new Pair<>(serverAddr, cachedConnection.transport); } ======= CachedConnection cachedConnection = getCache().get(ttk).reserveAny(); if (cachedConnection != null) { final String serverAddr = ttk.getServer().toString(); log.trace("Using existing connection to {}", serverAddr); return new Pair<String,TTransport>(serverAddr, cachedConnection.transport); >>>>>>> CachedConnection cachedConnection = getCache().get(ttk).reserveAny(); if (cachedConnection != null) { final String serverAddr = ttk.getServer().toString(); log.trace("Using existing connection to {}", serverAddr); return new Pair<>(serverAddr, cachedConnection.transport); <<<<<<< List<CachedConnection> cachedConnList = getCache().get(ttk); if (cachedConnList != null) { for (CachedConnection cachedConnection : cachedConnList) { if (!cachedConnection.isReserved()) { cachedConnection.setReserved(true); final String serverAddr = ttk.getServer().toString(); log.trace("Using existing connection to {} timeout {}", serverAddr, ttk.getTimeout()); return new Pair<>(serverAddr, cachedConnection.transport); } ======= CachedConnections cachedConns = getCache().get(ttk); if (cachedConns != null) { CachedConnection cachedConnection = cachedConns.reserveAny(); if (cachedConnection != null) { final String serverAddr = ttk.getServer().toString(); return new Pair<String,TTransport>(serverAddr, cachedConnection.transport); >>>>>>> CachedConnections cachedConns = getCache().get(ttk); if (cachedConns != null) { CachedConnection cachedConnection = cachedConns.reserveAny(); if (cachedConnection != null) { final String serverAddr = ttk.getServer().toString(); return new Pair<>(serverAddr, cachedConnection.transport);
<<<<<<< import org.robobinding.binding.viewattribute.provider.CompoundButtonAttributeProvider; ======= import org.robobinding.binding.viewattribute.provider.CheckBoxAttributeProvider; import org.robobinding.binding.viewattribute.provider.ImageViewAttributeProvider; import org.robobinding.binding.viewattribute.provider.ProgressBarAttributeProvider; import org.robobinding.binding.viewattribute.provider.SeekBarAttributeProvider; >>>>>>> import org.robobinding.binding.viewattribute.provider.CompoundButtonAttributeProvider; import org.robobinding.binding.viewattribute.provider.ImageViewAttributeProvider; import org.robobinding.binding.viewattribute.provider.ProgressBarAttributeProvider; import org.robobinding.binding.viewattribute.provider.SeekBarAttributeProvider; <<<<<<< import android.widget.CompoundButton; ======= import android.widget.CheckBox; import android.widget.ImageView; import android.widget.ProgressBar; import android.widget.SeekBar; >>>>>>> import android.widget.CompoundButton; import android.widget.ImageView; import android.widget.ProgressBar; import android.widget.SeekBar; <<<<<<< viewAttributeProviderMap.put(CompoundButton.class, new CompoundButtonAttributeProvider()); ======= viewAttributeProviderMap.put(CheckBox.class, new CheckBoxAttributeProvider()); viewAttributeProviderMap.put(ImageView.class, new ImageViewAttributeProvider()); viewAttributeProviderMap.put(ProgressBar.class, new ProgressBarAttributeProvider()); viewAttributeProviderMap.put(SeekBar.class, new SeekBarAttributeProvider()); >>>>>>> viewAttributeProviderMap.put(CompoundButton.class, new CompoundButtonAttributeProvider()); viewAttributeProviderMap.put(ImageView.class, new ImageViewAttributeProvider()); viewAttributeProviderMap.put(ProgressBar.class, new ProgressBarAttributeProvider()); viewAttributeProviderMap.put(SeekBar.class, new SeekBarAttributeProvider());
<<<<<<< import robobinding.beans.Function; import robobinding.presentationmodel.ItemClickEvent; ======= import robobinding.beans.Command; >>>>>>> import robobinding.beans.Function;
<<<<<<< import robobinding.value.ValueModel; ======= import robobinding.binding.viewattribute.VisibilityAttribute.BooleanVisibilityAttribute; import robobinding.presentationmodel.PresentationModelAdapter; import robobinding.property.PropertyValueModel; >>>>>>> import robobinding.property.PropertyValueModel; <<<<<<< ======= private PresentationModelAdapter presentationModelAdapter; private PropertyValueModel<Boolean> valueModel; >>>>>>>
<<<<<<< import robobinding.value.ValueModel; ======= import robobinding.binding.viewattribute.TextAttribute.CharSequenceTextAttribute; import robobinding.presentationmodel.PresentationModelAdapter; import robobinding.property.PropertyValueModel; >>>>>>> import robobinding.property.PropertyValueModel; <<<<<<< ======= private PresentationModelAdapter presentationModelAdapter; private PropertyValueModel<CharSequence> valueModel; >>>>>>>
<<<<<<< .getLicense()); license.append( new LicenseObj("CircleImageView", "Henning Dodenhof", "2014 - 2016", LicenseObj.APACHE) .getLicense()); ((TextView) findViewById(R.id.TV_about_text)).setText(license.toString()); ======= .getLincense()); lincense.append( new LicenseObj("pinyin4j", "Li Min", "2006", LicenseObj.GPLv2) .getLincense()); ((TextView) findViewById(R.id.TV_about_text)).setText(lincense.toString()); >>>>>>> .getLicense()); license.append( new LicenseObj("CircleImageView", "Henning Dodenhof", "2014 - 2016", LicenseObj.APACHE) .getLicense()); license.append( new LicenseObj("pinyin4j", "Li Min", "2006", LicenseObj.GPLv2) .getLicense()); ((TextView) findViewById(R.id.TV_about_text)).setText(license.toString());
<<<<<<< private VolleyNetworkStack(Context context, WaspHttpStack stack, Parser parser) { requestQueue = Volley.newRequestQueue(context, stack.getHttpStack()); // requestQueue = Volley.newRequestQueue(context); this.parser = parser; ======= private VolleyNetworkStack(Context context, WaspHttpStack stack) { requestQueue = Volley.newRequestQueue(context, (HttpStack) stack.getHttpStack()); >>>>>>> private VolleyNetworkStack(Context context, WaspHttpStack stack) { requestQueue = Volley.newRequestQueue(context, stack.getHttpStack());
<<<<<<< OWLOntologyID ontologyID = ont.getOntologyID(); IRI actualIRI = ontologyID.getOntologyIRI(); // Not really sure why this is here, but apparently we can get // an ontology without an IRI, in which case we'll generate one // that is 'sort of' unique (only fails if two different machines run // this tool at the exact same time). // if (actualIRI == null) { IRI generatedIRI = IRI.generateDocumentIRI(); actualIRI = generatedIRI; ======= IRI iri = null; OWLOntologyID ontologyID = ont.getOntologyID(); if (ontologyID != null) { Optional<IRI> optional = ontologyID.getOntologyIRI(); if (optional.isPresent()) { iri = optional.get(); } } if (iri == null) { iri = IRI.generateDocumentIRI(); >>>>>>> OWLOntologyID ontologyID = ont.getOntologyID(); IRI actualIRI = null; Optional<IRI> optional = ontologyID.getOntologyIRI(); if (optional.isPresent()) { actualIRI = optional.get();
<<<<<<< @JsfComponent(type = "org.richfaces.NotifyMessage", tag = @Tag(name = "notifyMessage"), renderer = @JsfRenderer(template = "notifyMessage.template.xml", type = "org.richfaces.NotifyMessageRenderer")) public abstract class AbstractNotifyMessage extends UIMessage implements AjaxOutput, ClientSideMessage, NotifyAttributes, AjaxOutputProps, CoreProps, EventsKeyProps, EventsMouseProps, I18nProps { ======= @JsfComponent(type = "org.richfaces.ui.NotifyMessage", tag = @Tag(name = "notifyMessage"), attributes = { "core-props.xml", "events-mouse-props.xml", "events-key-props.xml", "i18n-props.xml", "AjaxOutput-props.xml" }, renderer = @JsfRenderer(template = "notifyMessage.template.xml", type = "org.richfaces.ui.NotifyMessageRenderer")) public abstract class AbstractNotifyMessage extends UIMessage implements AjaxOutput, ClientSideMessage, NotifyAttributes { >>>>>>> @JsfComponent(type = "org.richfaces.NotifyMessage", tag = @Tag(name = "notifyMessage"), renderer = @JsfRenderer(template = "notifyMessage.template.xml", type = "org.richfaces.ui.NotifyMessageRenderer")) public abstract class AbstractNotifyMessage extends UIMessage implements AjaxOutput, ClientSideMessage, NotifyAttributes, AjaxOutputProps, CoreProps, EventsKeyProps, EventsMouseProps, I18nProps {
<<<<<<< @JsfComponent(type = AbstractSelect.COMPONENT_TYPE, family = AbstractSelect.COMPONENT_FAMILY, renderer = @JsfRenderer(type = "org.richfaces.SelectRenderer"), tag = @Tag(name = "select")) ======= @JsfComponent(type = AbstractSelect.COMPONENT_TYPE, family = AbstractSelect.COMPONENT_FAMILY, renderer = @JsfRenderer(type = "org.richfaces.ui.SelectRenderer"), tag = @Tag(name = "select"), attributes = { "core-props.xml", "events-mouse-props.xml", "events-key-props.xml", "select-props.xml" }) >>>>>>> @JsfComponent(type = AbstractSelect.COMPONENT_TYPE, family = AbstractSelect.COMPONENT_FAMILY, renderer = @JsfRenderer(type = "org.richfaces.ui.SelectRenderer"), tag = @Tag(name = "select")) <<<<<<< public abstract class AbstractSelect extends AbstractSelectComponent implements CoreProps, EventsKeyProps, EventsMouseProps, SelectProps { public static final String COMPONENT_TYPE = "org.richfaces.Select"; public static final String COMPONENT_FAMILY = "org.richfaces.Select"; ======= public abstract class AbstractSelect extends AbstractSelectComponent { public static final String COMPONENT_TYPE = "org.richfaces.ui.Select"; public static final String COMPONENT_FAMILY = "org.richfaces.ui.Select"; >>>>>>> public abstract class AbstractSelect extends AbstractSelectComponent implements CoreProps, EventsKeyProps, EventsMouseProps, SelectProps { public static final String COMPONENT_TYPE = "org.richfaces.ui.Select"; public static final String COMPONENT_FAMILY = "org.richfaces.ui.Select";
<<<<<<< renderer = @JsfRenderer(type = "org.richfaces.OrderingListRenderer"), tag = @Tag(name = "orderingList")) public abstract class AbstractOrderingList extends AbstractOrderingComponent implements SelectItemsInterface, EventsKeyProps, EventsMouseProps, MultiSelectProps { public static final String COMPONENT_TYPE = "org.richfaces.OrderingList"; public static final String COMPONENT_FAMILY = "org.richfaces.SelectMany"; ======= renderer = @JsfRenderer(type = "org.richfaces.ui.OrderingListRenderer"), tag = @Tag(name = "orderingList"), attributes = {"events-mouse-props.xml", "events-key-props.xml", "multiselect-props.xml"}) public abstract class AbstractOrderingList extends AbstractOrderingComponent implements SelectItemsInterface { public static final String COMPONENT_TYPE = "org.richfaces.ui.OrderingList"; public static final String COMPONENT_FAMILY = "org.richfaces.ui.SelectMany"; >>>>>>> renderer = @JsfRenderer(type = "org.richfaces.ui.OrderingListRenderer"), tag = @Tag(name = "orderingList")) public abstract class AbstractOrderingList extends AbstractOrderingComponent implements SelectItemsInterface, EventsKeyProps, EventsMouseProps, MultiSelectProps { public static final String COMPONENT_TYPE = "org.richfaces.ui.OrderingList"; public static final String COMPONENT_FAMILY = "org.richfaces.ui.SelectMany";
<<<<<<< @JsfComponent(type = AbstractTree.COMPONENT_TYPE, family = AbstractTree.COMPONENT_FAMILY, tag = @Tag(name = "tree", handlerClass = TreeHandler.class), renderer = @JsfRenderer(type = "org.richfaces.TreeRenderer")) ======= @JsfComponent(type = AbstractTree.COMPONENT_TYPE, family = AbstractTree.COMPONENT_FAMILY, tag = @Tag(name = "tree", handlerClass = TreeHandler.class), renderer = @JsfRenderer(type = "org.richfaces.ui.TreeRenderer"), attributes = { "ajax-props.xml", "events-mouse-props.xml", "events-key-props.xml", "core-props.xml", "i18n-props.xml", "tree-common-props.xml", "tree-props.xml", "sequence-props.xml", "immediate-prop.xml" }) >>>>>>> @JsfComponent(type = AbstractTree.COMPONENT_TYPE, family = AbstractTree.COMPONENT_FAMILY, tag = @Tag(name = "tree", handlerClass = TreeHandler.class), renderer = @JsfRenderer(type = "org.richfaces.ui.TreeRenderer")) <<<<<<< public abstract class AbstractTree extends UIDataAdaptor implements MetaComponentResolver, MetaComponentEncoder, TreeSelectionChangeSource, TreeToggleSource, AjaxProps, CoreProps, EventsKeyProps, EventsMouseProps, ImmediateProps, I18nProps, SequenceProps, TreeProps, TreeCommonProps { public static final String COMPONENT_TYPE = "org.richfaces.Tree"; public static final String COMPONENT_FAMILY = "org.richfaces.Tree"; ======= public abstract class AbstractTree extends UIDataAdaptor implements MetaComponentResolver, MetaComponentEncoder, TreeSelectionChangeSource, TreeToggleSource { public static final String COMPONENT_TYPE = "org.richfaces.ui.Tree"; public static final String COMPONENT_FAMILY = "org.richfaces.ui.Tree"; >>>>>>> public abstract class AbstractTree extends UIDataAdaptor implements MetaComponentResolver, MetaComponentEncoder, TreeSelectionChangeSource, TreeToggleSource, AjaxProps, CoreProps, EventsKeyProps, EventsMouseProps, ImmediateProps, I18nProps, SequenceProps, TreeProps, TreeCommonProps { public static final String COMPONENT_TYPE = "org.richfaces.ui.Tree"; public static final String COMPONENT_FAMILY = "org.richfaces.ui.Tree";
<<<<<<< @JsfComponent(family = AbstractDropDownMenu.COMPONENT_FAMILY, type = AbstractMenuGroup.COMPONENT_TYPE, facets = {@Facet(name = "icon", generate = false), @Facet(name = "iconDisabled", generate = false) }, renderer = @JsfRenderer(type = MenuGroupRendererBase.RENDERER_TYPE), tag = @Tag(name = "menuGroup")) public abstract class AbstractMenuGroup extends UIOutput implements CoreProps, EventsKeyProps, EventsMouseProps, I18nProps, PositionProps { public static final String COMPONENT_TYPE = "org.richfaces.MenuGroup"; ======= @JsfComponent(family = AbstractDropDownMenu.COMPONENT_FAMILY, type = AbstractMenuGroup.COMPONENT_TYPE, facets = { @Facet(name = "icon", generate = false), @Facet(name = "iconDisabled", generate = false) }, renderer = @JsfRenderer(type = MenuGroupRendererBase.RENDERER_TYPE), tag = @Tag(name = "menuGroup"), attributes = { "events-mouse-props.xml", "events-key-props.xml", "core-props.xml", "i18n-props.xml", "position-props.xml" }) public abstract class AbstractMenuGroup extends UIOutput { public static final String COMPONENT_TYPE = "org.richfaces.ui.MenuGroup"; >>>>>>> @JsfComponent(family = AbstractDropDownMenu.COMPONENT_FAMILY, type = AbstractMenuGroup.COMPONENT_TYPE, facets = {@Facet(name = "icon", generate = false), @Facet(name = "iconDisabled", generate = false) }, renderer = @JsfRenderer(type = MenuGroupRendererBase.RENDERER_TYPE), tag = @Tag(name = "menuGroup")) public abstract class AbstractMenuGroup extends UIOutput implements CoreProps, EventsKeyProps, EventsMouseProps, I18nProps, PositionProps { public static final String COMPONENT_TYPE = "org.richfaces.ui.MenuGroup";
<<<<<<< @JsfComponent(tag = @Tag(type = TagType.Facelets)) public abstract class AbstractPanelMenuGroup extends AbstractPanelMenuItem implements AjaxProps, BypassProps, EventsMouseProps, StyleProps, StyleClassProps { public static final String COMPONENT_TYPE = "org.richfaces.PanelMenuGroup"; public static final String COMPONENT_FAMILY = "org.richfaces.PanelMenuGroup"; ======= @JsfComponent(tag = @Tag(type = TagType.Facelets), attributes = { "style-prop.xml", "styleClass-prop.xml", "ajax-props.xml", "bypass-props.xml", "events-mouse-props.xml" }) public abstract class AbstractPanelMenuGroup extends AbstractPanelMenuItem { public static final String COMPONENT_TYPE = "org.richfaces.ui.PanelMenuGroup"; public static final String COMPONENT_FAMILY = "org.richfaces.ui.PanelMenuGroup"; >>>>>>> @JsfComponent(tag = @Tag(type = TagType.Facelets)) public abstract class AbstractPanelMenuGroup extends AbstractPanelMenuItem implements AjaxProps, BypassProps, EventsMouseProps, StyleProps, StyleClassProps { public static final String COMPONENT_TYPE = "org.richfaces.ui.PanelMenuGroup"; public static final String COMPONENT_FAMILY = "org.richfaces.ui.PanelMenuGroup";
<<<<<<< @JsfComponent(renderer = @JsfRenderer(type = "org.richfaces.FunctionRenderer"), tag = @Tag(name = "jsFunction", type = TagType.Facelets)) public abstract class AbstractAjaxFunction extends AbstractActionComponent implements AjaxProps { ======= @JsfComponent(renderer = @JsfRenderer(type = "org.richfaces.ui.FunctionRenderer"), tag = @Tag(name = "jsFunction", type = TagType.Facelets), attributes = { "ajax-props.xml" }) public abstract class AbstractAjaxFunction extends AbstractActionComponent { >>>>>>> @JsfComponent(renderer = @JsfRenderer(type = "org.richfaces.ui.FunctionRenderer"), tag = @Tag(name = "jsFunction", type = TagType.Facelets)) public abstract class AbstractAjaxFunction extends AbstractActionComponent implements AjaxProps {
<<<<<<< renderer = @JsfRenderer(type = "org.richfaces.InputNumberSpinnerRenderer"), ======= renderer = @JsfRenderer(type = "org.richfaces.ui.InputNumberSpinnerRenderer"), attributes = {"events-mouse-props.xml", "events-key-props.xml", "base-props.xml", "core-props.xml", "input-props.xml", "focus-props.xml", "i18n-props.xml" }, >>>>>>> renderer = @JsfRenderer(type = "org.richfaces.ui.InputNumberSpinnerRenderer"), <<<<<<< public abstract class AbstractInputNumberSpinner extends AbstractInputNumber implements AccesskeyProps, BaseProps, CoreProps, EventsKeyProps, EventsMouseProps, FocusProps, I18nProps, InputProps { public static final String COMPONENT_TYPE = "org.richfaces.InputNumberSpinner"; ======= public abstract class AbstractInputNumberSpinner extends AbstractInputNumber implements AccesskeyProps { public static final String COMPONENT_TYPE = "org.richfaces.ui.InputNumberSpinner"; >>>>>>> public abstract class AbstractInputNumberSpinner extends AbstractInputNumber implements AccesskeyProps, BaseProps, CoreProps, EventsKeyProps, EventsMouseProps, FocusProps, I18nProps, InputProps { public static final String COMPONENT_TYPE = "org.richfaces.ui.InputNumberSpinner";
<<<<<<< import com.chrisnewland.jitwatch.model.*; ======= import com.chrisnewland.jitwatch.model.*; import org.slf4j.Logger; import org.slf4j.LoggerFactory; >>>>>>> import com.chrisnewland.jitwatch.model.*; import com.chrisnewland.jitwatch.model.*; import org.slf4j.Logger; import org.slf4j.LoggerFactory;
<<<<<<< import com.chrisnewland.jitwatch.loader.BytecodeLoader; import com.chrisnewland.jitwatch.util.ParseUtil; ======= import com.chrisnewland.jitwatch.loader.BytecodeLoader; import com.chrisnewland.jitwatch.model.bytecode.ClassBC; import com.chrisnewland.jitwatch.util.ParseUtil; >>>>>>> import com.chrisnewland.jitwatch.loader.BytecodeLoader; import com.chrisnewland.jitwatch.util.ParseUtil; import com.chrisnewland.jitwatch.loader.BytecodeLoader; import com.chrisnewland.jitwatch.model.bytecode.ClassBC; import com.chrisnewland.jitwatch.util.ParseUtil;
<<<<<<< import net.minecraft.util.math.vector.Vector3d; ======= import net.minecraft.util.math.Vec3d; import org.lwjgl.opengl.GL11; >>>>>>> import net.minecraft.util.math.vector.Vector3d; import org.lwjgl.opengl.GL11; <<<<<<< if (buf instanceof BufferBuilder) { Vector3d view = RenderInfo.getInstance().getARI().getProjectedView(); ======= if (buf instanceof BufferBuilder && this.getRenderType().getDrawMode() == GL11.GL_QUADS) { Vec3d view = RenderInfo.getInstance().getARI().getProjectedView(); >>>>>>> if (buf instanceof BufferBuilder && this.getRenderType().getDrawMode() == GL11.GL_QUADS) { Vector3d view = RenderInfo.getInstance().getARI().getProjectedView();
<<<<<<< public Multimap<Attribute, AttributeModifier> getAttributeModifiers(EquipmentSlotType slot, ItemStack stack) { Multimap<Attribute, AttributeModifier> multimap = super.getAttributeModifiers(slot, stack); ======= public Multimap<String, AttributeModifier> getAttributeModifiers(EquipmentSlotType slot, ItemStack stack) { Multimap<String, AttributeModifier> multimap = HashMultimap.create(); >>>>>>> public Multimap<Attribute, AttributeModifier> getAttributeModifiers(EquipmentSlotType slot, ItemStack stack) { Multimap<Attribute, AttributeModifier> multimap = HashMultimap.create();
<<<<<<< import net.minecraft.world.World; ======= import net.minecraft.world.dimension.DimensionType; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; >>>>>>> import net.minecraft.world.World; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn;
<<<<<<< Functions.LINEAR_LUCK_BONUS = registerFunction(new LinearLuckBonus.Serializer(), AstralSorcery.key("linear_luck_bonus")); Functions.RANDOM_CRYSTAL_PROPERTIES = registerFunction(new RandomCrystalProperty.Serializer(), AstralSorcery.key("random_crystal_property")); Functions.COPY_CRYSTAL_PROPERTIES = registerFunction(new CopyCrystalProperties.Serializer(), AstralSorcery.key("copy_crystal_properties")); Functions.COPY_CONSTELLATION = registerFunction(new CopyConstellation.Serializer(), AstralSorcery.key("copy_constellation")); ======= registerFunction(new LinearLuckBonus.Serializer(AstralSorcery.key("linear_luck_bonus"))); registerFunction(new RandomCrystalProperty.Serializer(AstralSorcery.key("random_crystal_property"))); registerFunction(new CopyCrystalProperties.Serializer(AstralSorcery.key("copy_crystal_properties"))); registerFunction(new CopyConstellation.Serializer(AstralSorcery.key("copy_constellation"))); registerFunction(new CopyGatewayColor.Serializer(AstralSorcery.key("copy_gateway_color"))); >>>>>>> Functions.LINEAR_LUCK_BONUS = registerFunction(new LinearLuckBonus.Serializer(), AstralSorcery.key("linear_luck_bonus")); Functions.RANDOM_CRYSTAL_PROPERTIES = registerFunction(new RandomCrystalProperty.Serializer(), AstralSorcery.key("random_crystal_property")); Functions.COPY_CRYSTAL_PROPERTIES = registerFunction(new CopyCrystalProperties.Serializer(), AstralSorcery.key("copy_crystal_properties")); Functions.COPY_CONSTELLATION = registerFunction(new CopyConstellation.Serializer(), AstralSorcery.key("copy_constellation")); registerFunction(new CopyGatewayColor.Serializer(AstralSorcery.key("copy_gateway_color")));
<<<<<<< public Multimap<Attribute, AttributeModifier> getAttributeModifiers(EquipmentSlotType slot, ItemStack stack) { Multimap<Attribute, AttributeModifier> multimap = super.getAttributeModifiers(slot, stack); ======= public Multimap<String, AttributeModifier> getAttributeModifiers(EquipmentSlotType slot, ItemStack stack) { Multimap<String, AttributeModifier> multimap = HashMultimap.create(); >>>>>>> public Multimap<Attribute, AttributeModifier> getAttributeModifiers(EquipmentSlotType slot, ItemStack stack) { Multimap<Attribute, AttributeModifier> multimap = HashMultimap.create();
<<<<<<< public static final ITag.INamedTag<Item> DUSTS_STARDUST = itemTag(ASTRAL_SORCERY, "stardust"); public static final ITag.INamedTag<Item> INGOTS_STARMETAL = itemTag(ASTRAL_SORCERY, "starmetal"); public static final ITag.INamedTag<Item> COLORED_LENS = itemTag(ASTRAL_SORCERY, "colored_lens"); ======= public static final Tag<Item> FORGE_GEM_AQUAMARINE = itemTagForge("gems/aquamarine"); public static final Tag<Item> DUSTS_STARDUST = itemTag(ASTRAL_SORCERY, "stardust"); public static final Tag<Item> INGOTS_STARMETAL = itemTag(ASTRAL_SORCERY, "starmetal"); public static final Tag<Item> COLORED_LENS = itemTag(ASTRAL_SORCERY, "colored_lens"); >>>>>>> public static final Tag<Item> FORGE_GEM_AQUAMARINE = itemTagForge("gems/aquamarine"); public static final ITag.INamedTag<Item> DUSTS_STARDUST = itemTag(ASTRAL_SORCERY, "stardust"); public static final ITag.INamedTag<Item> INGOTS_STARMETAL = itemTag(ASTRAL_SORCERY, "starmetal"); public static final ITag.INamedTag<Item> COLORED_LENS = itemTag(ASTRAL_SORCERY, "colored_lens");
<<<<<<< private Map<ResourceLocation, Set<BlockPos>> clientPositions = new HashMap<>(); public boolean doesPositionReceiveStarlightClient(World world, BlockPos pos) { return this.clientPositions.getOrDefault(world.func_234923_W_().func_240901_a_(), Collections.emptySet()).contains(pos); ======= private final Map<DimensionType, Set<BlockPos>> clientPositions = new HashMap<>(); public boolean doesPositionReceiveStarlightClient(IWorld world, BlockPos pos) { return this.clientPositions.getOrDefault(world.getDimension().getType(), Collections.emptySet()).contains(pos); >>>>>>> private final Map<ResourceLocation, Set<BlockPos>> clientPositions = new HashMap<>(); public boolean doesPositionReceiveStarlightClient(World world, BlockPos pos) { return this.clientPositions.getOrDefault(world.func_234923_W_().func_240901_a_(), Collections.emptySet()).contains(pos);
<<<<<<< private static Map<ResourceLocation, List<TimeStopZone>> activeTimeStopZones = new HashMap<>(); ======= private static final Map<DimensionType, List<TimeStopZone>> activeTimeStopZones = new HashMap<>(); >>>>>>> private static final Map<ResourceLocation, List<TimeStopZone>> activeTimeStopZones = new HashMap<>();
<<<<<<< private Map<ResourceLocation, Map<BlockPos, Set<BlockPos>>> serverPosBuffer = new HashMap<>(); ======= private final Map<DimensionType, Map<BlockPos, Set<BlockPos>>> serverPosBuffer = new HashMap<>(); >>>>>>> private final Map<ResourceLocation, Map<BlockPos, Set<BlockPos>>> serverPosBuffer = new HashMap<>(); <<<<<<< private Map<ResourceLocation, LinkedList<Tuple<TransmissionChain.LightConnection, Boolean>>> serverChangeBuffer = new HashMap<>(); private Set<ResourceLocation> dimensionClearBuffer = new HashSet<>(); ======= private final Map<DimensionType, LinkedList<Tuple<TransmissionChain.LightConnection, Boolean>>> serverChangeBuffer = new HashMap<>(); private final Set<DimensionType> dimensionClearBuffer = new HashSet<>(); >>>>>>> private final Map<ResourceLocation, LinkedList<Tuple<TransmissionChain.LightConnection, Boolean>>> serverChangeBuffer = new HashMap<>(); private final Set<ResourceLocation> dimensionClearBuffer = new HashSet<>();
<<<<<<< private Map<ResourceLocation, List<TimeStopEffectHelper>> clientActiveFreezeZones = new HashMap<>(); ======= private final Map<DimensionType, List<TimeStopEffectHelper>> clientActiveFreezeZones = new HashMap<>(); >>>>>>> private final Map<ResourceLocation, List<TimeStopEffectHelper>> clientActiveFreezeZones = new HashMap<>();
<<<<<<< private Map<ResourceLocation, List<TimeStopEffectHelper>> serverActiveFreezeZones = new HashMap<>(); ======= private final Map<DimensionType, List<TimeStopEffectHelper>> serverActiveFreezeZones = new HashMap<>(); >>>>>>> private final Map<ResourceLocation, List<TimeStopEffectHelper>> serverActiveFreezeZones = new HashMap<>(); <<<<<<< private final ResourceLocation dim; private TimeStopEffectHelper involvedEffect; ======= private final DimensionType dimType; private final TimeStopEffectHelper involvedEffect; >>>>>>> private final ResourceLocation dim; private final TimeStopEffectHelper involvedEffect;
<<<<<<< edanrs_DE.add(5); edanrs_DE.add(6); ======= // edanrs_DE.add(5); //for english Set<Integer> edanrs_EN = new HashSet<Integer>(); //add indices for edas edanrs_EN.add(1); // edanrs_EN.add(2); // edanrs_EN.add(3); // edanrs_EN.add(4); edanrs_EN.add(5); >>>>>>> // edanrs_DE.add(5); // edanrs_DE.add(6); //for english Set<Integer> edanrs_EN = new HashSet<Integer>(); //add indices for edas edanrs_EN.add(1); // edanrs_EN.add(2); // edanrs_EN.add(3); // edanrs_EN.add(4); edanrs_EN.add(5);
<<<<<<< import org.picketlink.idm.spi.StoreFactory; import static java.util.Collections.unmodifiableList; import static java.util.Collections.unmodifiableMap; ======= import org.picketlink.idm.spi.StoreSelector; >>>>>>> import org.picketlink.idm.spi.StoreSelector; import static java.util.Collections.unmodifiableList; import static java.util.Collections.unmodifiableMap; <<<<<<< private final List<IdentityStoreConfiguration> configuredStores; ======= private final List<IdentityStoreConfiguration> configuredStores = new ArrayList<IdentityStoreConfiguration>(); private final StoreSelector storeFactory; >>>>>>> private final List<IdentityStoreConfiguration> configuredStores; private final StoreSelector storeFactory;
<<<<<<< import java.util.Arrays; import java.util.List; ======= import static org.picketlink.idm.IDMLogger.LOGGER; import static org.picketlink.idm.IDMMessages.MESSAGES; import java.util.Collections; >>>>>>> import java.util.Arrays; import java.util.List; <<<<<<< public DefaultPartitionManager(List<IdentityConfiguration> configurations) { this(configurations, null, null); } public DefaultPartitionManager(IdentityConfiguration configuration) { this(Arrays.asList(configuration), null, null); ======= public DefaultPartitionManager(Map<String,IdentityConfiguration> configurations) { this(configurations, null, null); >>>>>>> public DefaultPartitionManager(List<IdentityConfiguration> configurations) { this(configurations, null, null); } public DefaultPartitionManager(IdentityConfiguration configuration) { this(Arrays.asList(configuration), null, null); <<<<<<< public DefaultPartitionManager(List<IdentityConfiguration> configurations, EventBridge eventBridge, IdGenerator idGenerator) { this(configurations, eventBridge, idGenerator, null); ======= public DefaultPartitionManager(Map<String,IdentityConfiguration> configurations, EventBridge eventBridge, IdGenerator idGenerator) { this(configurations, eventBridge, idGenerator, null); >>>>>>> public DefaultPartitionManager(List<IdentityConfiguration> configurations, EventBridge eventBridge, IdGenerator idGenerator) { this(configurations, eventBridge, idGenerator, null); <<<<<<< public DefaultPartitionManager(List<IdentityConfiguration> configurations, EventBridge eventBridge, IdGenerator idGenerator, String partitionManagementConfigName) { ======= public DefaultPartitionManager(Map<String,IdentityConfiguration> configurations, EventBridge eventBridge, IdGenerator idGenerator, String partitionManagementConfigName) { >>>>>>> public DefaultPartitionManager(List<IdentityConfiguration> configurations, EventBridge eventBridge, IdGenerator idGenerator, String partitionManagementConfigName) { <<<<<<< for (IdentityConfiguration identityConfiguration: configurations) { this.configurations.put(identityConfiguration.getName(), identityConfiguration); } ======= >>>>>>> for (IdentityConfiguration identityConfiguration: configurations) { this.configurations.put(identityConfiguration.getName(), identityConfiguration); }
<<<<<<< public class SAMLEntityDescriptorParser implements ParserNamespaceSupport { private static final PicketLinkLogger logger = PicketLinkLoggerFactory.getLogger(); ======= public class SAMLEntityDescriptorParser extends AbstractDescriptorParser implements ParserNamespaceSupport { >>>>>>> public class SAMLEntityDescriptorParser extends AbstractDescriptorParser implements ParserNamespaceSupport { private static final PicketLinkLogger logger = PicketLinkLoggerFactory.getLogger();
<<<<<<< import org.cornutum.regexpgen.RegExpGen; import org.cornutum.regexpgen.js.Parser; import static org.cornutum.regexpgen.Bounds.bounded; ======= import org.apache.commons.lang3.text.WordUtils; >>>>>>> import org.apache.commons.lang3.text.WordUtils; import org.cornutum.regexpgen.RegExpGen; import org.cornutum.regexpgen.js.Parser; import static org.cornutum.regexpgen.Bounds.bounded;
<<<<<<< public List<VirtualFile> getAssetFiles() { final List<VirtualFile> files = new ArrayList<VirtualFile>(); VirtualFile projectDirectory = project.getBaseDir(); final VirtualFile webDirectory = VfsUtil.findRelativeFile(projectDirectory, "web"); if (null == webDirectory) { return files; } ProjectFileIndex fileIndex = ProjectFileIndex.SERVICE.getInstance(project); fileIndex.iterateContentUnderDirectory(webDirectory, new ContentIterator() { @Override public boolean processFile(final VirtualFile virtualFile) { if (!virtualFile.isDirectory()) { files.add(virtualFile); } return true; } }); return files; } ======= private Map<String, String> configParameter; private Long configParameterLastModified; public Map<String, String> getConfigParameter() { String defaultServiceMapFilePath = getPath(project, Settings.getInstance(project).pathToProjectContainer); File xmlFile = new File(defaultServiceMapFilePath); if (!xmlFile.exists()) { return new HashMap<String, String>(); } // this is called async, so double check for configParameter and configParameterLastModified Long xmlFileLastModified = xmlFile.lastModified(); if (configParameter != null && xmlFileLastModified.equals(configParameterLastModified)) { return configParameter; } configParameterLastModified = xmlFileLastModified; try { ParameterParser parser = new ParameterParser(); return configParameter = parser.parse(xmlFile); } catch (Exception ignored) { return configParameter = new HashMap<String, String>(); } } >>>>>>> public List<VirtualFile> getAssetFiles() { final List<VirtualFile> files = new ArrayList<VirtualFile>(); VirtualFile projectDirectory = project.getBaseDir(); final VirtualFile webDirectory = VfsUtil.findRelativeFile(projectDirectory, "web"); if (null == webDirectory) { return files; } ProjectFileIndex fileIndex = ProjectFileIndex.SERVICE.getInstance(project); fileIndex.iterateContentUnderDirectory(webDirectory, new ContentIterator() { @Override public boolean processFile(final VirtualFile virtualFile) { if (!virtualFile.isDirectory()) { files.add(virtualFile); } return true; } }); return files; } private Map<String, String> configParameter; private Long configParameterLastModified; public Map<String, String> getConfigParameter() { String defaultServiceMapFilePath = getPath(project, Settings.getInstance(project).pathToProjectContainer); File xmlFile = new File(defaultServiceMapFilePath); if (!xmlFile.exists()) { return new HashMap<String, String>(); } // this is called async, so double check for configParameter and configParameterLastModified Long xmlFileLastModified = xmlFile.lastModified(); if (configParameter != null && xmlFileLastModified.equals(configParameterLastModified)) { return configParameter; } configParameterLastModified = xmlFileLastModified; try { ParameterParser parser = new ParameterParser(); return configParameter = parser.parse(xmlFile); } catch (Exception ignored) { return configParameter = new HashMap<String, String>(); } }
<<<<<<< import com.ch_linghu.fanfoudroid.data.db.TwitterDbAdapter; ======= import com.ch_linghu.fanfoudroid.data.db.StatusDatabase; import com.ch_linghu.fanfoudroid.data.db.StatusTablesInfo.StatusTable; >>>>>>> import com.ch_linghu.fanfoudroid.data.db.StatusDatabase; import com.ch_linghu.fanfoudroid.data.db.TwitterDbAdapter; <<<<<<< ======= private void doSend() { if (mSendTask != null && mSendTask.getStatus() == UserTask.Status.RUNNING) { Log.w(TAG, "Already sending."); } else { String to = mToEdit.getText().toString(); String status = mTweetEdit.getText().toString(); if (!Utils.isEmpty(status) && !Utils.isEmpty(to)) { mSendTask = new SendTask().execute(); } else if (Utils.isEmpty(status)) { updateProgress(getString(R.string.direct_meesage_status_texting_is_null)); } else if (Utils.isEmpty(to)) { updateProgress(getString(R.string.direct_meesage_status_user_is_null)); } } } private class SendTask extends UserTask<Void, Void, TaskResult> { @Override public void onPreExecute() { disableEntry(); updateProgress(getString(R.string.page_status_updating)); } @Override public TaskResult doInBackground(Void... params) { try { String user = mToEdit.getText().toString(); String text = mTweetEdit.getText().toString(); DirectMessage directMessage = getApi().sendDirectMessage(user, text); Dm dm = Dm.create(directMessage, true); if (!Utils.isEmpty(dm.profileImageUrl)) { // Fetch image to cache. try { getImageManager().put(dm.profileImageUrl); } catch (IOException e) { Log.e(TAG, e.getMessage(), e); } } getDb().createDm(dm, false); } catch (WeiboException e) { Log.i(TAG, e.getMessage()); // TODO: check is this is actually the case. return TaskResult.NOT_FOLLOWED_ERROR; } return TaskResult.OK; } @Override public void onPostExecute(TaskResult result) { if (isCancelled()) { // Canceled doesn't really mean "canceled" in this task. // We want the request to complete, but don't want to update the // activity (it's probably dead). return; } if (result == TaskResult.AUTH_ERROR) { logout(); } else if (result == TaskResult.OK) { mToEdit.setText(""); mTweetEdit.setText(""); updateProgress(""); enableEntry(); //发送成功就直接关闭界面 finish(); } else if (result == TaskResult.NOT_FOLLOWED_ERROR) { updateProgress(getString(R.string.direct_meesage_status_the_person_not_following_you)); enableEntry(); } else if (result == TaskResult.IO_ERROR) { //TODO: 什么情况下会抛出IO_ERROR?需要给用户更为具体的失败原因 updateProgress(getString(R.string.page_status_unable_to_update)); enableEntry(); } } } private static class FriendsAdapter extends CursorAdapter { public FriendsAdapter(Context context, Cursor cursor) { super(context, cursor); mInflater = LayoutInflater.from(context); //FIXME: // mUserTextColumn = cursor.getColumnIndexOrThrow(StatusTable.FIELD_USER_SCREEN_NAME); } private LayoutInflater mInflater; private int mUserTextColumn; @Override public View newView(Context context, Cursor cursor, ViewGroup parent) { View view = mInflater.inflate(R.layout.dropdown_item, parent, false); ViewHolder holder = new ViewHolder(); holder.userText = (TextView) view.findViewById(android.R.id.text1); view.setTag(holder); return view; } class ViewHolder { public TextView userText; } @Override public void bindView(View view, Context context, Cursor cursor) { ViewHolder holder = (ViewHolder) view.getTag(); //FIXME: // holder.userText.setText(cursor.getString(mUserTextColumn)); } @Override public Cursor runQueryOnBackgroundThread(CharSequence constraint) { String filter = constraint == null ? "" : constraint.toString(); return TwitterApplication.mDb.getFollowerUsernames(filter); } @Override public String convertToString(Cursor cursor) { //FIXME: // return cursor.getString(mUserTextColumn); return ""; } } >>>>>>>
<<<<<<< import com.ch_linghu.fanfoudroid.data.db.TwitterDbAdapter; ======= import com.ch_linghu.fanfoudroid.data.db.StatusTablesInfo.StatusTable; import com.ch_linghu.fanfoudroid.task.Followable; import com.ch_linghu.fanfoudroid.task.HasFavorite; import com.ch_linghu.fanfoudroid.task.Retrievable; >>>>>>> import com.ch_linghu.fanfoudroid.data.db.StatusTablesInfo.StatusTable;
<<<<<<< ======= import android.view.GestureDetector; import android.view.GestureDetector.SimpleOnGestureListener; >>>>>>> import android.view.GestureDetector; import android.view.GestureDetector.SimpleOnGestureListener; <<<<<<< ======= import android.view.View.OnTouchListener; >>>>>>> import android.view.View.OnTouchListener; <<<<<<< protected FlingGestureListener myGestureListener = null; ======= /* class FlingGestureListener2 extends SimpleOnGestureListener implements OnTouchListener { private static final String TAG = "FlipperGestureListener"; private static final int SWIPE_MIN_DISTANCE = 120; private static final int SWIPE_MAX_DISTANCE = 350; private static final int SWIPE_THRESHOLD_VELOCITY = 150; private Widget.OnGestureListener mListener; private GestureDetector gDetector; public FlingGestureListener2(Context context, Widget.OnGestureListener listener) { this(context, listener, null); } public FlingGestureListener2(Context context, Widget.OnGestureListener listener, GestureDetector gDetector) { if (gDetector == null) { gDetector = new GestureDetector(context, this); } this.gDetector = gDetector; mListener = listener; } @Override public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) { Log.d(TAG, "On fling"); boolean result = super.onFling(e1, e2, velocityX, velocityY); final float xDistance = Math.abs(e1.getX() - e2.getX()); final float yDistance = Math.abs(e1.getY() - e2.getY()); velocityX = Math.abs(velocityX); velocityY = Math.abs(velocityY); try { if (xDistance > SWIPE_MAX_DISTANCE || yDistance > SWIPE_MAX_DISTANCE) { Log.d(TAG, "OFF_PATH"); return result; } if (velocityX > SWIPE_THRESHOLD_VELOCITY && xDistance > SWIPE_MIN_DISTANCE) { if (e1.getX() > e2.getX()) { Log.d(TAG, "<------"); result = mListener.onFlingLeft(e1, e1, velocityX, velocityY); overridePendingTransition(R.anim.push_left_in, R.anim.push_left_out); } else { Log.d(TAG, "------>"); result = mListener.onFlingRight(e1, e1, velocityX, velocityY); overridePendingTransition(R.anim.push_right_in, R.anim.push_right_out); } } else if (velocityY > SWIPE_THRESHOLD_VELOCITY && yDistance > SWIPE_MIN_DISTANCE) { if (e1.getY() > e2.getY()) { Log.d(TAG, "up"); result = mListener.onFlingUp(e1, e1, velocityX, velocityY); } else { Log.d(TAG, "down"); result = mListener.onFlingDown(e1, e1, velocityX, velocityY); } } else { Log.d(TAG, "miss"); } } catch (Exception e) { e.printStackTrace(); Log.e(TAG, "onFling error " + e.getMessage()); } Log.i(TAG, "push_right"); return result; } @Override public void onLongPress(MotionEvent e) { // TODO Auto-generated method stub super.onLongPress(e); } @Override public boolean onTouch(View v, MotionEvent event) { Log.d("FLING", "On Touch"); // Within the MyGestureListener class you can now manage the // event.getAction() codes. // Note that we are now calling the gesture Detectors onTouchEvent. // And given we've set this class as the GestureDetectors listener // the onFling, onSingleTap etc methods will be executed. return gDetector.onTouchEvent(event); } public GestureDetector getDetector() { return gDetector; } } @Override public void finish() { super.finish(); } protected FlingGestureListener2 myGestureListener2 = null; */ protected FlingGestureListener myGestureListener = null; >>>>>>> protected FlingGestureListener myGestureListener = null; <<<<<<< getTweetList().setOnTouchListener(myGestureListener); ======= getTweetList().setOnTouchListener(myGestureListener); >>>>>>> getTweetList().setOnTouchListener(myGestureListener);
<<<<<<< import com.ch_linghu.fanfoudroid.task.Deletable; ======= import com.ch_linghu.fanfoudroid.task.TaskResult; >>>>>>> import com.ch_linghu.fanfoudroid.task.Deletable; import com.ch_linghu.fanfoudroid.task.TaskResult;
<<<<<<< !useEuropeanDateFormat && !showTemperatureDecimalPoint && !useThin && !useThinAmbient && showInfoBarAmbient && !showWearIcon && !advanced && firstLaunch; ======= !useEuropeanDateFormat && !showTemperatureDecimalPoint && !useThinAmbient && useGrayInfoAmbient && showInfoBarAmbient && !showWearIcon && !advanced && firstLaunch; >>>>>>> !useEuropeanDateFormat && !showTemperatureDecimalPoint && !useThin && !useThinAmbient && useGrayInfoAmbient && showInfoBarAmbient && !showWearIcon && !advanced && firstLaunch;
<<<<<<< private boolean showTemperature, showWeatherIcon, useCelsius, useThinAmbient, showInfoBarAmbient, showTemperatureFractional, showBattery, showWearIcon, useDarkSky, weatherChangeNotified, companionAppNotified, advanced; ======= private boolean use24HourTime, showTemperature, showWeatherIcon, useCelsius, useEuropeanDateFormat, useThin, useThinAmbient, useGrayInfoAmbient, showInfoBarAmbient, showTemperatureFractional, showBattery, showWearIcon, useDarkSky, weatherChangeNotified, companionAppNotified, advanced; >>>>>>> private boolean showTemperature, showWeatherIcon, useCelsius, useThin, useThinAmbient, useGrayInfoAmbient, showInfoBarAmbient, showTemperatureFractional, showBattery, showWearIcon, useDarkSky, weatherChangeNotified, companionAppNotified, advanced; <<<<<<< public boolean isUseThinAmbient() { return useThinAmbient; ======= public boolean isUseEuropeanDateFormat() { return useEuropeanDateFormat; } public void setUseEuropeanDateFormat(boolean value) { useEuropeanDateFormat = value; } public boolean isUseThin() { return useThin; >>>>>>> public boolean isUseThin() { return useThin;
<<<<<<< Copyright (c) 2002-2016 ymnk, JCraft,Inc. All rights reserved. ======= Copyright (c) 2002-2014 ymnk, JCraft,Inc. All rights reserved. Copyright (c) 2018, D. R. Commander. All rights reserved. >>>>>>> Copyright (c) 2002-2016 ymnk, JCraft,Inc. All rights reserved. Copyright (c) 2018, D. R. Commander. All rights reserved.
<<<<<<< Copyright (c) 2002-2016 ymnk, JCraft,Inc. All rights reserved. ======= Copyright (c) 2002-2014 ymnk, JCraft,Inc. All rights reserved. Copyright (c) 2018, D. R. Commander. All rights reserved. >>>>>>> Copyright (c) 2002-2016 ymnk, JCraft,Inc. All rights reserved. Copyright (c) 2018, D. R. Commander. All rights reserved. <<<<<<< Class c=Class.forName(session.getConfig(hash)); sha=(HASH)(c.newInstance()); ======= Class c=Class.forName(session.getConfig("sha-1")); sha=(HASH)(c.getDeclaredConstructor().newInstance()); >>>>>>> Class c=Class.forName(session.getConfig(hash)); sha=(HASH)(c.getDeclaredConstructor().newInstance()); <<<<<<< // Since JDK8, SunJCE has lifted the keysize restrictions // from 1024 to 2048 for DH. preferred = max = check2048(c, max); dh=(com.jcraft.jsch.DH)(c.newInstance()); ======= dh=(com.jcraft.jsch.DH)(c.getDeclaredConstructor().newInstance()); >>>>>>> // Since JDK8, SunJCE has lifted the keysize restrictions // from 1024 to 2048 for DH. preferred = max = check2048(c, max); dh=(com.jcraft.jsch.DH)(c.getDeclaredConstructor().newInstance());
<<<<<<< Copyright (c) 2013-2016 ymnk, JCraft,Inc. All rights reserved. ======= Copyright (c) 2013-2014 ymnk, JCraft,Inc. All rights reserved. Copyright (c) 2018, D. R. Commander. All rights reserved. >>>>>>> Copyright (c) 2013-2016 ymnk, JCraft,Inc. All rights reserved. Copyright (c) 2018, D. R. Commander. All rights reserved.
<<<<<<< Copyright (c) 2002-2016 ymnk, JCraft,Inc. All rights reserved. ======= Copyright (c) 2002-2014 ymnk, JCraft,Inc. All rights reserved. Copyright (c) 2018, D. R. Commander. All rights reserved. >>>>>>> Copyright (c) 2002-2016 ymnk, JCraft,Inc. All rights reserved. Copyright (c) 2018, D. R. Commander. All rights reserved.
<<<<<<< if (cc != null) cc.deleteWindow(); ======= if (cc != null) cc.deleteWindow(true); } else if (cc.shuttingDown && embed.getValue()) { reportException(new WarningException("Connection closed")); >>>>>>> if (cc != null) cc.deleteWindow(true);
<<<<<<< ======= @Test public void testformatDateFromUTC() throws ParseException { String string1 = "2001-07-04T12:08:56Z"; assertEquals("2001-07-04 12:08:56", ParsePrimitiveUtils.nonUTCFormat(string1)); } >>>>>>> @Test public void testformatDateFromUTC() throws ParseException { String string1 = "2001-07-04T12:08:56Z"; assertEquals("2001-07-04 12:08:56", ParsePrimitiveUtils.nonUTCFormat(string1)); }
<<<<<<< for (long i = 0; i < opts.num; i++) { byte[] row = encodeLong(i + opts.start); String value = "" + (i + opts.start); Mutation m = new Mutation(new Text(row)); if (delete) { m.putDelete(new Text("cf"), new Text("cq")); } else { m.put(new Text("cf"), new Text("cq"), new Value(value.getBytes())); ======= final Text CF = new Text("cf"), CQ = new Text("cq"); final byte[] CF_BYTES = "cf".getBytes(Constants.UTF8), CQ_BYTES = "cq".getBytes(Constants.UTF8); if (opts.mode.equals("ingest") || opts.mode.equals("delete")) { BatchWriter bw = connector.createBatchWriter(opts.tableName, bwOpts.getBatchWriterConfig()); boolean delete = opts.mode.equals("delete"); for (long i = 0; i < opts.num; i++) { byte[] row = encodeLong(i + opts.start); String value = "" + (i + opts.start); Mutation m = new Mutation(new Text(row)); if (delete) { m.putDelete(CF, CQ); } else { m.put(CF, CQ, new Value(value.getBytes(Constants.UTF8))); } bw.addMutation(m); >>>>>>> for (long i = 0; i < opts.num; i++) { byte[] row = encodeLong(i + opts.start); String value = "" + (i + opts.start); Mutation m = new Mutation(new Text(row)); if (delete) { m.putDelete(CF, CQ); } else { m.put(CF, CQ, new Value(value.getBytes(Constants.UTF8))); <<<<<<< ======= Key startKey = new Key(encodeLong(opts.start), CF_BYTES, CQ_BYTES, new byte[0], Long.MAX_VALUE); Key stopKey = new Key(encodeLong(opts.start + opts.num - 1), CF_BYTES, CQ_BYTES, new byte[0], 0); >>>>>>> <<<<<<< checkKeyValue(row, k, v); ======= // System.out.println("v = "+v); checkKeyValue(i, k, v); i++; } if (i != opts.start + opts.num) { System.err.println("ERROR : did not see expected number of rows, saw " + (i - opts.start) + " expected " + opts.num); System.err.println("exiting... ARGHHHHHH"); System.exit(1); } long t2 = System.currentTimeMillis(); System.out.printf("time : %9.2f secs%n", ((t2 - t1) / 1000.0)); System.out.printf("rate : %9.2f entries/sec%n", opts.num / ((t2 - t1) / 1000.0)); } else if (opts.mode.equals("randomLookups")) { int numLookups = 1000; Random r = new Random(); long t1 = System.currentTimeMillis(); for (int i = 0; i < numLookups; i++) { long row = ((r.nextLong() & 0x7fffffffffffffffl) % opts.num) + opts.start; Scanner s = connector.createScanner(opts.tableName, opts.auths); s.setBatchSize(scanOpts.scanBatchSize); Key startKey = new Key(encodeLong(row), CF_BYTES, CQ_BYTES, new byte[0], Long.MAX_VALUE); Key stopKey = new Key(encodeLong(row), CF_BYTES, CQ_BYTES, new byte[0], 0); s.setRange(new Range(startKey, stopKey)); Iterator<Entry<Key,Value>> si = s.iterator(); >>>>>>> checkKeyValue(row, k, v);
<<<<<<< Config.build().withEncryption() ======= Neo4jRunner.DEFAULT_AUTH_TOKEN, Config.build().withEncryptionLevel( EncryptionLevel.REQUIRED ) >>>>>>> Neo4jRunner.DEFAULT_AUTH_TOKEN, Config.build().withEncryption() <<<<<<< Config.build().withEncryption() ======= Neo4jRunner.DEFAULT_AUTH_TOKEN, Config.build().withEncryptionLevel( EncryptionLevel.REQUIRED ) >>>>>>> Neo4jRunner.DEFAULT_AUTH_TOKEN, Config.build().withEncryption() <<<<<<< Config.build().withEncryption() ======= Neo4jRunner.DEFAULT_AUTH_TOKEN, Config.build().withEncryptionLevel( EncryptionLevel.REQUIRED ) >>>>>>> Neo4jRunner.DEFAULT_AUTH_TOKEN, Config.build().withEncryption()
<<<<<<< import org.neo4j.driver.v1.ResultCursor; import org.neo4j.driver.v1.Session; ======= import org.neo4j.driver.v1.Record; import org.neo4j.driver.v1.StatementResult; >>>>>>> import org.neo4j.driver.v1.Session; import org.neo4j.driver.v1.Record; import org.neo4j.driver.v1.StatementResult; <<<<<<< import static org.neo4j.driver.v1.tck.Environment.driver; ======= import static org.neo4j.driver.v1.Values.ofValue; import static org.neo4j.driver.v1.tck.DriverComplianceIT.session; >>>>>>> import static org.neo4j.driver.v1.tck.Environment.driver; import static org.neo4j.driver.v1.Values.ofValue;
<<<<<<< // Given config with sessionLivenessCheckTimeout not set, i.e. turned off try ( Driver driver = GraphDatabase.driver( DEFAULT_URI, DEFAULT_AUTH_TOKEN, config.toConfig() ) ) ======= // Given // config with sessionLivenessCheckTimeout not set, i.e. turned off Config config = Config.build().withEncryptionLevel( encryptionLevel ).toConfig(); try ( Driver driver = GraphDatabase.driver( DEFAULT_URI, DEFAULT_AUTH_TOKEN, config ) ) >>>>>>> // Given config with sessionLivenessCheckTimeout not set, i.e. turned off try ( Driver driver = GraphDatabase.driver( DEFAULT_URI, DEFAULT_AUTH_TOKEN, config.toConfig() ) ) <<<<<<< AuthToken auth = AuthTokens.basic( TestNeo4j.USER, TestNeo4j.PASSWORD ); RoutingSettings routingSettings = new RoutingSettings( 1, 1, null ); ======= RoutingSettings routingSettings = new RoutingSettings( 1, 1 ); >>>>>>> RoutingSettings routingSettings = new RoutingSettings( 1, 1, null ); <<<<<<< return factory.newInstance( DEFAULT_URI, auth, routingSettings, retrySettings, config ); ======= return factory.newInstance( DEFAULT_URI, DEFAULT_AUTH_TOKEN, routingSettings, retrySettings, config ); >>>>>>> return factory.newInstance( DEFAULT_URI, DEFAULT_AUTH_TOKEN, routingSettings, retrySettings, config );
<<<<<<< void shouldPropagateFailureFromListAsync() ======= public void shouldNotDisableAutoReadWhenAutoReadManagementDisabled() { Connection connection = connectionMock(); PullAllResponseHandler handler = newHandler( asList( "key1", "key2" ), connection ); handler.disableAutoReadManagement(); for ( int i = 0; i < PullAllResponseHandler.RECORD_BUFFER_HIGH_WATERMARK + 1; i++ ) { handler.onRecord( values( 100, 200 ) ); } verify( connection, never() ).disableAutoRead(); } @Test public void shouldPropagateFailureFromListAsync() >>>>>>> void shouldNotDisableAutoReadWhenAutoReadManagementDisabled() { Connection connection = connectionMock(); PullAllResponseHandler handler = newHandler( asList( "key1", "key2" ), connection ); handler.disableAutoReadManagement(); for ( int i = 0; i < PullAllResponseHandler.RECORD_BUFFER_HIGH_WATERMARK + 1; i++ ) { handler.onRecord( values( 100, 200 ) ); } verify( connection, never() ).disableAutoRead(); } @Test void shouldPropagateFailureFromListAsync()
<<<<<<< import java.util.Map; import org.neo4j.driver.v1.ResultCursor; import org.neo4j.driver.v1.Session; ======= import org.neo4j.driver.v1.StatementResult; >>>>>>> import org.neo4j.driver.v1.Session; <<<<<<< private ResultCursor result; private Session session; ======= private StatementResult result; >>>>>>> private StatementResult result; private Session session;
<<<<<<< import org.neo4j.driver.AccessMode; import org.neo4j.driver.AuthToken; import org.neo4j.driver.AuthTokens; import org.neo4j.driver.Config; import org.neo4j.driver.Driver; import org.neo4j.driver.GraphDatabase; import org.neo4j.driver.Record; import org.neo4j.driver.Session; import org.neo4j.driver.StatementResult; import org.neo4j.driver.Transaction; import org.neo4j.driver.TransactionWork; import org.neo4j.driver.exceptions.ServiceUnavailableException; import org.neo4j.driver.exceptions.SessionExpiredException; import org.neo4j.driver.net.ServerAddress; import org.neo4j.driver.net.ServerAddressResolver; import org.neo4j.driver.util.StubServer; ======= import org.neo4j.driver.v1.AccessMode; import org.neo4j.driver.v1.AuthToken; import org.neo4j.driver.v1.AuthTokens; import org.neo4j.driver.v1.Config; import org.neo4j.driver.v1.Driver; import org.neo4j.driver.v1.GraphDatabase; import org.neo4j.driver.v1.Logger; import org.neo4j.driver.v1.Logging; import org.neo4j.driver.v1.Record; import org.neo4j.driver.v1.Session; import org.neo4j.driver.v1.StatementResult; import org.neo4j.driver.v1.Transaction; import org.neo4j.driver.v1.TransactionWork; import org.neo4j.driver.v1.exceptions.ServiceUnavailableException; import org.neo4j.driver.v1.exceptions.SessionExpiredException; import org.neo4j.driver.v1.exceptions.TransientException; import org.neo4j.driver.v1.net.ServerAddress; import org.neo4j.driver.v1.net.ServerAddressResolver; import org.neo4j.driver.v1.util.StubServer; >>>>>>> import org.neo4j.driver.net.ServerAddress; import org.neo4j.driver.net.ServerAddressResolver; import org.neo4j.driver.util.StubServer;
<<<<<<< import org.neo4j.driver.internal.messaging.ResponseMessageHandler; import org.neo4j.driver.internal.spi.AutoReadManagingResponseHandler; ======= import org.neo4j.driver.internal.messaging.MessageHandler; >>>>>>> import org.neo4j.driver.internal.messaging.ResponseMessageHandler;
<<<<<<< Driver driver = GraphDatabase.driver( neo4j.uri() ); Session session = driver.session(); ======= try( Driver driver = GraphDatabase.driver( neo4j.address() ) ) { Session session = driver.session(); >>>>>>> try( Driver driver = GraphDatabase.driver( neo4j.uri() ); ) { Session session = driver.session(); <<<<<<< Driver driver = GraphDatabase.driver( neo4j.uri(), AuthTokens.none(), null ); Session session = driver.session(); ======= try( Driver driver = GraphDatabase.driver( neo4j.address(), AuthTokens.none(), null ) ) { Session session = driver.session(); >>>>>>> try( Driver driver = GraphDatabase.driver( neo4j.uri(), AuthTokens.none(), null ) ) { Session session = driver.session(); <<<<<<< Driver driver = GraphDatabase.driver( neo4j.uri(), token); Session session = driver.session(); ======= try ( Driver driver = GraphDatabase.driver( neo4j.address(), token ) ) { Session session = driver.session(); >>>>>>> try ( Driver driver = GraphDatabase.driver( neo4j.uri(), token) ) { Session session = driver.session();
<<<<<<< import org.neo4j.driver.internal.messaging.ResponseMessageHandler; ======= import org.neo4j.driver.internal.messaging.MessageHandler; import org.neo4j.driver.internal.spi.AutoReadManagingResponseHandler; >>>>>>> import org.neo4j.driver.internal.messaging.ResponseMessageHandler; import org.neo4j.driver.internal.spi.AutoReadManagingResponseHandler; <<<<<<< ======= /** * Makes this message dispatcher not send ACK_FAILURE in response to FAILURE until it's un-muted using * {@link #unMuteAckFailure()}. Muting ACK_FAILURE is needed <b>only</b> when sending RESET message. RESET "jumps" * over all queued messages on server and makes them fail. Received failures do not need to be acknowledge because * RESET moves server's state machine to READY state. * <p> * <b>This method is not thread-safe</b> and should only be executed by the event loop thread. */ public void muteAckFailure() { ackFailureMuted = true; } /** * Makes this message dispatcher send ACK_FAILURE in response to FAILURE. Should be used in combination with * {@link #muteAckFailure()} when sending RESET message. * <p> * <b>This method is not thread-safe</b> and should only be executed by the event loop thread. */ public void unMuteAckFailure() { ackFailureMuted = false; } /** * Check if ACK_FAILURE is muted. * <p> * <b>This method is not thread-safe</b> and should only be executed by the event loop thread. * * @return {@code true} if ACK_FAILURE has been muted via {@link #muteAckFailure()}, {@code false} otherwise. */ public boolean isAckFailureMuted() { return ackFailureMuted; } /** * <b>Visible for testing</b> */ AutoReadManagingResponseHandler autoReadManagingHandler() { return autoReadManagingHandler; } private void ackFailureIfNeeded() { if ( !ackFailureMuted ) { enqueue( new AckFailureResponseHandler( this ) ); channel.writeAndFlush( ACK_FAILURE, channel.voidPromise() ); } } private ResponseHandler removeHandler() { ResponseHandler handler = handlers.remove(); if ( handler == autoReadManagingHandler ) { // the auto-read managing handler is being removed // make sure this dispatcher does not hold on to a removed handler updateAutoReadManagingHandler( null ); } return handler; } private void updateAutoReadManagingHandlerIfNeeded( ResponseHandler handler ) { if ( handler instanceof AutoReadManagingResponseHandler ) { updateAutoReadManagingHandler( (AutoReadManagingResponseHandler) handler ); } } private void updateAutoReadManagingHandler( AutoReadManagingResponseHandler newHandler ) { if ( autoReadManagingHandler != null ) { // there already exists a handler that manages channel's auto-read // make it stop because new managing handler is being added and there should only be a single such handler autoReadManagingHandler.disableAutoReadManagement(); // restore the default value of auto-read channel.config().setAutoRead( true ); } autoReadManagingHandler = newHandler; } >>>>>>> /** * <b>Visible for testing</b> */ AutoReadManagingResponseHandler autoReadManagingHandler() { return autoReadManagingHandler; } private ResponseHandler removeHandler() { ResponseHandler handler = handlers.remove(); if ( handler == autoReadManagingHandler ) { // the auto-read managing handler is being removed // make sure this dispatcher does not hold on to a removed handler updateAutoReadManagingHandler( null ); } return handler; } private void updateAutoReadManagingHandlerIfNeeded( ResponseHandler handler ) { if ( handler instanceof AutoReadManagingResponseHandler ) { updateAutoReadManagingHandler( (AutoReadManagingResponseHandler) handler ); } } private void updateAutoReadManagingHandler( AutoReadManagingResponseHandler newHandler ) { if ( autoReadManagingHandler != null ) { // there already exists a handler that manages channel's auto-read // make it stop because new managing handler is being added and there should only be a single such handler autoReadManagingHandler.disableAutoReadManagement(); // restore the default value of auto-read channel.config().setAutoRead( true ); } autoReadManagingHandler = newHandler; }
<<<<<<< try (Scanner scanner = conn.createScanner(table, Authorizations.EMPTY)) { scanner.enableIsolation(); scanner.addScanIterator(iterCfg); for (int i = 0; i < 100; i++) { Iterator<Entry<Key,Value>> iter = scanner.iterator(); Assert.assertTrue(iter.hasNext()); Assert.assertEquals("000A", iter.next().getKey().getColumnQualifierData().toString()); Assert.assertFalse(iter.hasNext()); } ======= Scanner scanner = conn.createScanner(table, Authorizations.EMPTY); scanner.enableIsolation(); scanner.addScanIterator(iterCfg); for (int i = 0; i < 100; i++) { Iterator<Entry<Key,Value>> iter = scanner.iterator(); assertTrue(iter.hasNext()); assertEquals("000A", iter.next().getKey().getColumnQualifierData().toString()); assertFalse(iter.hasNext()); >>>>>>> try (Scanner scanner = conn.createScanner(table, Authorizations.EMPTY)) { scanner.enableIsolation(); scanner.addScanIterator(iterCfg); for (int i = 0; i < 100; i++) { Iterator<Entry<Key,Value>> iter = scanner.iterator(); assertTrue(iter.hasNext()); assertEquals("000A", iter.next().getKey().getColumnQualifierData().toString()); assertFalse(iter.hasNext()); }
<<<<<<< import org.neo4j.driver.internal.util.ServerVersion; ======= import org.neo4j.driver.v1.exceptions.TransientException; import org.neo4j.driver.v1.util.DaemonThreadFactory; import org.neo4j.driver.v1.util.ServerVersion; >>>>>>> import org.neo4j.driver.internal.util.ServerVersion; import org.neo4j.driver.v1.exceptions.TransientException; import org.neo4j.driver.v1.util.DaemonThreadFactory;
<<<<<<< ======= import static org.mockito.Mockito.only; import static org.mockito.Mockito.times; >>>>>>> import static org.mockito.Mockito.only;
<<<<<<< db.execSQL("CREATE TABLE accounts (" + "name TEXT, " + // 0 "tokenKey TEXT, "+ // 1 "tokenSecret TEXT, "+ // 2 "serverUrl TEXT, " + // 3 "serverType )" // 4 ); ======= db.execSQL(CREATE_TABLE + TABLE_SEARCHES + " ("+ "name STRING, "+ "id LONG, " + ACCOUNT_ID + " LONG, " + "query STRING, " + "json STRING )" ); >>>>>>> db.execSQL("CREATE TABLE accounts (" + "name TEXT, " + // 0 "tokenKey TEXT, "+ // 1 "tokenSecret TEXT, "+ // 2 "serverUrl TEXT, " + // 3 "serverType )" // 4 ); db.execSQL(CREATE_TABLE + TABLE_SEARCHES + " ("+ "name STRING, "+ "id LONG, " + ACCOUNT_ID + " LONG, " + "query STRING, " + "json STRING )" ); <<<<<<< ======= public void deleteSearch(int id) { SQLiteDatabase db = tdHelper.getWritableDatabase(); db.delete(TABLE_SEARCHES,ACCOUNT_ID_IS + " AND id = ?",new String[]{account,String.valueOf(id)}); db.close(); } >>>>>>> public void deleteSearch(int id) { SQLiteDatabase db = tdHelper.getWritableDatabase(); db.delete(TABLE_SEARCHES,ACCOUNT_ID_IS + " AND id = ?",new String[]{account,String.valueOf(id)}); db.close(); }
<<<<<<< ======= private static final SecurityPermission SYSTEM_CREDENTIALS_PERMISSION = new SecurityPermission("systemCredentialsPermission"); >>>>>>>
<<<<<<< * <br> A panel that is used for all the main content widgets. * <br> This maps to the &lt;div class="ui-content" role="main" /> element in the page. ======= * A panel that is used for all the main content widgets. * This maps to the &lt;div class="ui-content" role="main" /&gt; element in the page. >>>>>>> * <br> A panel that is used for all the main content widgets. * <br> This maps to the &lt;div class="ui-content" role="main" /&gt; element in the page.
<<<<<<< import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import org.apache.axiom.om.OMAttribute; import org.apache.axiom.om.OMElement; import org.apache.axiom.om.OMNamespace; import org.apache.axiom.om.impl.builder.StAXOMBuilder; ======= >>>>>>> import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import org.apache.axiom.om.OMAttribute; import org.apache.axiom.om.OMElement; import org.apache.axiom.om.OMNamespace; import org.apache.axiom.om.impl.builder.StAXOMBuilder; <<<<<<< @SuppressFBWarnings("PATH_TRAVERSAL_IN") private void initScripts(OMElement moduleOM, Context cx, JavaScriptModule module, boolean isCustom) ======= private void initScripts(Module moduleObject, Context cx, JavaScriptModule module, boolean isCustom) >>>>>>> @SuppressFBWarnings("PATH_TRAVERSAL_IN") private void initScripts(Module moduleObject, Context cx, JavaScriptModule module, boolean isCustom) <<<<<<< @SuppressFBWarnings("PATH_TRAVERSAL_IN") @Override public CodeSource getCodeSource() throws ScriptException { ======= @Override public CodeSource getCodeSource() throws ScriptException { >>>>>>> @SuppressFBWarnings("PATH_TRAVERSAL_IN") @Override public CodeSource getCodeSource() throws ScriptException {
<<<<<<< @SuppressFBWarnings("PATH_TRAVERSAL_IN") protected void handleZipWebappDeployment(File webapp, List<WebContextParameter> webContextParams, List<Object> applicationEventListeners) throws CarbonException { ======= protected void handleZipWebappDeployment(File webapp, List<WebContextParameter> webContextParams, List<Object> applicationEventListeners) throws CarbonException { >>>>>>> @SuppressFBWarnings("PATH_TRAVERSAL_IN") protected void handleZipWebappDeployment(File webapp, List<WebContextParameter> webContextParams, List<Object> applicationEventListeners) throws CarbonException { <<<<<<< Context contextForHost = DataHolder.getCarbonTomcatService().addWebApp(host, "/", webappFile.getAbsolutePath(), new JaggeryConfListener(jaggeryConfigObj, securityConstraint)); ======= /* ApplicationContext.getCurrentApplicationContext().putUrlMappingForApplication(hostName, contextStr); */ Context contextForHost = DataHolder.getCarbonTomcatService() .addWebApp(host, "/", webappFile.getAbsolutePath(), new JaggeryDeployerManager.JaggeryConfListener(jaggeryConfigObj, securityConstraint)); >>>>>>> /* ApplicationContext.getCurrentApplicationContext().putUrlMappingForApplication(hostName, contextStr); */ Context contextForHost = DataHolder.getCarbonTomcatService() .addWebApp(host, "/", webappFile.getAbsolutePath(), new JaggeryDeployerManager.JaggeryConfListener(jaggeryConfigObj, securityConstraint)); <<<<<<< ======= >>>>>>> <<<<<<< private static class JaggeryConfListener implements LifecycleListener { private JSONObject jaggeryConfig; private SecurityConstraint securityConstraint; private JaggeryConfListener(JSONObject jaggeryConfig, SecurityConstraint securityConstraint) { this.jaggeryConfig = jaggeryConfig; this.securityConstraint = securityConstraint; } public void lifecycleEvent(LifecycleEvent event) { if (Lifecycle.BEFORE_START_EVENT.equals(event.getType())) { initJaggeryappDefaults((Context) event.getLifecycle(), this.jaggeryConfig, this.securityConstraint); return; } if (Lifecycle.START_EVENT.equals(event.getType())) { Context context = (Context) event.getLifecycle(); try { WebAppManager.getEngine().enterContext(); WebAppManager.deploy(context); setDisplayName(context, jaggeryConfig); if (jaggeryConfig != null) { addSessionCreatedListners(context, (JSONArray) jaggeryConfig.get(JaggeryCoreConstants.JaggeryConfigParams.SESSION_CREATED_LISTENER_SCRIPTS)); addSessionDestroyedListners(context, (JSONArray) jaggeryConfig.get(JaggeryCoreConstants.JaggeryConfigParams.SESSION_DESTROYED_LISTENER_SCRIPTS)); executeScripts(context, (JSONArray) jaggeryConfig.get(JaggeryCoreConstants.JaggeryConfigParams.INIT_SCRIPTS)); addUrlMappings(context, jaggeryConfig); } } catch (ScriptException e) { log.error(e.getMessage(), e); try { context.destroy(); } catch (LifecycleException e1) { log.error(e1.getMessage(), e1); } } finally { RhinoEngine.exitContext(); } return; } if (Lifecycle.STOP_EVENT.equals(event.getType())) { Context context = (Context) event.getLifecycle(); try { WebAppManager.getEngine().enterContext(); WebAppManager.undeploy(context); if (jaggeryConfig != null) { executeScripts(context, (JSONArray) jaggeryConfig.get(JaggeryCoreConstants.JaggeryConfigParams.DESTROY_SCRIPTS)); } } catch (ScriptException e) { log.error(e.getMessage(), e); } finally { RhinoEngine.exitContext(); } return; } } } private static void initJaggeryappDefaults(Context ctx, JSONObject jaggeryConfig, SecurityConstraint securityConstraint) { Tomcat.addServlet(ctx, JaggeryCoreConstants.JAGGERY_SERVLET_NAME, JaggeryCoreConstants.JAGGERY_SERVLET_CLASS); Tomcat.addServlet(ctx, JaggeryCoreConstants.JAGGERY_WEBSOCKET_SERVLET_NAME, JaggeryCoreConstants.JAGGERY_WEBSOCKET_SERVLET_CLASS); addContextParams(ctx, jaggeryConfig); addListeners(ctx, jaggeryConfig); addServlets(ctx, jaggeryConfig); addFilters(ctx, jaggeryConfig); FilterDef filterDef = new FilterDef(); filterDef.setFilterName(JaggeryCoreConstants.JAGGERY_FILTER_NAME); filterDef.setFilterClass(JaggeryCoreConstants.JAGGERY_FILTER_CLASS); ctx.addFilterDef(filterDef); FilterMap filterMapping = new FilterMap(); filterMapping.setFilterName(JaggeryCoreConstants.JAGGERY_FILTER_NAME); filterMapping.addURLPattern(JaggeryCoreConstants.JAGGERY_URL_PATTERN); ctx.addFilterMap(filterMapping); ctx.addApplicationListener(JaggeryCoreConstants.JAGGERY_APPLICATION_SESSION_LISTENER); ctx.addConstraint(securityConstraint); addWelcomeFiles(ctx, jaggeryConfig); //jaggery conf params if null conf is not available if (jaggeryConfig != null) { setDisplayName(ctx, jaggeryConfig); addErrorPages(ctx, jaggeryConfig); addSecurityConstraints(ctx, jaggeryConfig); setLoginConfig(ctx, jaggeryConfig); addSecurityRoles(ctx, jaggeryConfig); // addUrlMappings(ctx, jaggeryConfig); addParameters(ctx, jaggeryConfig); addLogLevel(ctx, jaggeryConfig); } } @SuppressFBWarnings("PATH_TRAVERSAL_IN") private JSONObject readJaggeryConfig(File file) throws IOException { File confFile = new File(file.getAbsolutePath() + File.separator + JaggeryCoreConstants.JAGGERY_CONF_FILE); ======= private JSONObject readJaggeryConfig(File f) throws IOException { File confFile = new File(f.getAbsolutePath() + File.separator + JaggeryCoreConstants.JAGGERY_CONF_FILE); >>>>>>> private JSONObject readJaggeryConfig(File f) throws IOException { File confFile = new File(f.getAbsolutePath() + File.separator + JaggeryCoreConstants.JAGGERY_CONF_FILE);
<<<<<<< public class KilometersPerHour extends Quantity<Double> { ======= public class KilometersPerHour extends Quantity<Number> implements Unit { >>>>>>> public class KilometersPerHour extends Quantity<Number> {
<<<<<<< import com.openxc.measurements.HeadlampStatus; import com.openxc.measurements.HighBeamStatus; ======= import com.openxc.measurements.FuelLevel; >>>>>>> import com.openxc.measurements.HeadlampStatus; import com.openxc.measurements.HighBeamStatus; import com.openxc.measurements.FuelLevel; <<<<<<< public void testGetPowertrainTorque() throws UnrecognizedMeasurementTypeException, NoValueException, RemoteException, InterruptedException { PowertrainTorque measurement = (PowertrainTorque) service.get(PowertrainTorque.class); checkReceivedMeasurement(measurement); assertEquals(measurement.getValue().doubleValue(), 232.1); } @MediumTest ======= public void testGetFuelLevel() throws UnrecognizedMeasurementTypeException, NoValueException, RemoteException, InterruptedException { FuelLevel measurement = (FuelLevel) service.get(FuelLevel.class); checkReceivedMeasurement(measurement); assertEquals(measurement.getValue().doubleValue(), 71.2); } @MediumTest >>>>>>> public void testGetPowertrainTorque() throws UnrecognizedMeasurementTypeException, NoValueException, RemoteException, InterruptedException { PowertrainTorque measurement = (PowertrainTorque) service.get(PowertrainTorque.class); checkReceivedMeasurement(measurement); assertEquals(measurement.getValue().doubleValue(), 232.1); } @MediumTest public void testGetFuelLevel() throws UnrecognizedMeasurementTypeException, NoValueException, RemoteException, InterruptedException { FuelLevel measurement = (FuelLevel) service.get(FuelLevel.class); checkReceivedMeasurement(measurement); assertEquals(measurement.getValue().doubleValue(), 71.2); } @MediumTest
<<<<<<< import java.nio.charset.StandardCharsets; ======= import static org.easymock.EasyMock.createMock; import static org.easymock.EasyMock.expect; import static org.easymock.EasyMock.replay; import static org.junit.Assert.assertEquals; >>>>>>> import static org.easymock.EasyMock.createMock; import static org.easymock.EasyMock.expect; import static org.easymock.EasyMock.replay; import static org.junit.Assert.assertEquals; import java.nio.charset.StandardCharsets;
<<<<<<< ======= import androidx.core.app.ActivityCompat; import androidx.core.content.ContextCompat; >>>>>>> import androidx.core.content.ContextCompat;
<<<<<<< ======= if(mUsbDevice != null) { mUsbDevice.close(); } >>>>>>> <<<<<<< try { mUsbDevice = new UsbVehicleDataSource(this); } catch(DataSourceException e) { Log.w(TAG, "Unable to add default USB data source", e); } mController = mUsbDevice; mPipeline.addSource(mUsbDevice); ======= if(mUsbDevice != null) { mPipeline.addSource(mUsbDevice); } >>>>>>> try { mUsbDevice = new UsbVehicleDataSource(this); mPipeline.addSource(mUsbDevice); mController = mUsbDevice; } catch(DataSourceException e) { Log.w(TAG, "Unable to add default USB data source", e); } <<<<<<< if(mController != null) { mController.set(measurement); } ======= if(mController != null) { mController.set(measurement); } else { Log.w(TAG, "Unable to set value -- controller is " + mController); } >>>>>>> if(mController != null) { mController.set(measurement); } else { Log.w(TAG, "Unable to set value -- controller is " + mController); }
<<<<<<< }else if (rawUrl.startsWith("jdbc:inspur:")) { return JdbcConstants.KDB_DRIVER; }else { ======= } else if (rawUrl.startsWith("jdbc:polardb")) { return JdbcConstants.POLARDB_DRIVER; } else { >>>>>>> } else if (rawUrl.startsWith("jdbc:inspur:")) { return JdbcConstants.KDB_DRIVER; } else if (rawUrl.startsWith("jdbc:polardb")) { return JdbcConstants.POLARDB_DRIVER; } else { <<<<<<< }else if (rawUrl.startsWith("jdbc:inspur:")) { return JdbcConstants.KDB; }else { ======= } else if (rawUrl.startsWith("jdbc:polardb")) { return POLARDB; } else { >>>>>>> } else if (rawUrl.startsWith("jdbc:inspur:")) { return JdbcConstants.KDB; } else if (rawUrl.startsWith("jdbc:polardb")) { return POLARDB; } else {
<<<<<<< AuthenticationToken token = getAdminToken(); if (token instanceof KerberosToken) { deleteTest(c, getCluster(), getAdminPrincipal(), null, tableName, getAdminUser().getKeytab().getAbsolutePath()); } else if (token instanceof PasswordToken) { PasswordToken passwdToken = (PasswordToken) token; deleteTest(c, getCluster(), getAdminPrincipal(), new String(passwdToken.getPassword(), Charsets.UTF_8), tableName, null); ======= PasswordToken token = (PasswordToken) getToken(); deleteTest(c, getCluster(), new String(token.getPassword(), UTF_8), tableName); try { getCluster().getClusterControl().adminStopAll(); } finally { getCluster().start(); >>>>>>> AuthenticationToken token = getAdminToken(); if (token instanceof KerberosToken) { deleteTest(c, getCluster(), getAdminPrincipal(), null, tableName, getAdminUser().getKeytab().getAbsolutePath()); } else if (token instanceof PasswordToken) { PasswordToken passwdToken = (PasswordToken) token; deleteTest(c, getCluster(), getAdminPrincipal(), new String(passwdToken.getPassword(), UTF_8), tableName, null);
<<<<<<< Map<TKeyExtent,List<TRange>> thriftTabletRanges = Translator.translate(requested, Translator.KET, new Translator.ListTranslator<Range,TRange>( Translator.RT)); InitialMultiScan imsr = client.startMultiScan(Tracer.traceInfo(), credentials.toThrift(instance), thriftTabletRanges, Translator.translate(columns, Translator.CT), options.serverSideIteratorList, options.serverSideIteratorOptions, ByteBufferUtil.toByteBuffers(authorizations.getAuthorizations()), waitForWrites); ======= Map<TKeyExtent,List<TRange>> thriftTabletRanges = Translator.translate(requested, Translators.KET, new Translator.ListTranslator<Range,TRange>( Translators.RT)); InitialMultiScan imsr = client.startMultiScan(Tracer.traceInfo(), credentials, thriftTabletRanges, Translator.translate(columns, Translators.CT), options.serverSideIteratorList, options.serverSideIteratorOptions, ByteBufferUtil.toByteBuffers(authorizations.getAuthorizations()), waitForWrites); >>>>>>> Map<TKeyExtent,List<TRange>> thriftTabletRanges = Translator.translate(requested, Translators.KET, new Translator.ListTranslator<Range,TRange>( Translators.RT)); InitialMultiScan imsr = client.startMultiScan(Tracer.traceInfo(), credentials.toThrift(instance), thriftTabletRanges, Translator.translate(columns, Translators.CT), options.serverSideIteratorList, options.serverSideIteratorOptions, ByteBufferUtil.toByteBuffers(authorizations.getAuthorizations()), waitForWrites);