conflict_resolution
stringlengths
27
16k
<<<<<<< import org.killbill.billing.invoice.api.InvoiceListenerService; import org.killbill.billing.invoice.api.InvoiceNotifier; ======= >>>>>>> import org.killbill.billing.invoice.api.InvoiceListenerService; <<<<<<< installInvoiceServices(); installInvoiceNotifier(); ======= installInvoiceService(); >>>>>>> installInvoiceServices();
<<<<<<< import com.ning.billing.util.api.TagApiException; ======= import com.ning.billing.junction.api.BillingEventSet; >>>>>>> <<<<<<< import com.ning.billing.util.svcapi.junction.BillingEvent; import com.ning.billing.util.svcapi.junction.BillingEventSet; import com.ning.billing.util.svcapi.junction.BillingModeType; import com.ning.billing.util.tag.ControlTagType; import com.ning.billing.util.tag.Tag; import com.ning.billing.util.tag.dao.AuditedTagDao; import com.ning.billing.util.tag.dao.TagDao; ======= >>>>>>> import com.ning.billing.util.svcapi.junction.BillingEvent; import com.ning.billing.util.svcapi.junction.BillingEventSet; import com.ning.billing.util.svcapi.junction.BillingModeType;
<<<<<<< public RequestProcessor(final Clock clock, final AccountUserApi accountUserApi, final PaymentApi paymentApi, final Bus eventBus, final GlobalLocker locker) { ======= public RequestProcessor(Clock clock, AccountUserApi accountUserApi, PaymentApi paymentApi, PaymentProviderPluginRegistry pluginRegistry) { >>>>>>> public RequestProcessor(final Clock clock, final AccountUserApi accountUserApi, final PaymentApi paymentApi, final GlobalLocker locker) {
<<<<<<< import com.google.inject.name.Named; ======= >>>>>>> import com.google.inject.name.Named; <<<<<<< import com.ning.billing.entitlement.api.user.DefaultSubscriptionFactory; ======= >>>>>>> <<<<<<< private final EntitlementUserApi userApi; private final EntitlementBillingApi billingApi; private final EntitlementMigrationApi migrationApi; private final EntitlementRepairApi repairApi; ======= >>>>>>> <<<<<<< EntitlementConfig config, DefaultEntitlementUserApi userApi, DefaultEntitlementBillingApi billingApi, EntitlementRepairApi repairApi, DefaultEntitlementMigrationApi migrationApi, AddonUtils addonUtils, Bus eventBus, ======= EntitlementConfig config, AddonUtils addonUtils, Bus eventBus, >>>>>>> EntitlementConfig config, AddonUtils addonUtils, Bus eventBus, <<<<<<< this.userApi = userApi; this.repairApi = repairApi; this.billingApi = billingApi; this.migrationApi = migrationApi; ======= >>>>>>> <<<<<<< @Override public EntitlementUserApi getUserApi() { return userApi; } @Override public EntitlementBillingApi getBillingApi() { return billingApi; } @Override public EntitlementMigrationApi getMigrationApi() { return migrationApi; } @Override public EntitlementRepairApi getRepairApi() { return repairApi; } ======= >>>>>>>
<<<<<<< import org.skife.jdbi.v2.tweak.HandleCallback; ======= >>>>>>> <<<<<<< ======= import com.ning.billing.KillbillTestSuiteWithEmbeddedDB; import com.ning.billing.dbi.MysqlTestingHelper; >>>>>>> <<<<<<< private final Logger log = LoggerFactory.getLogger(TestNotificationQueue.class); ======= >>>>>>>
<<<<<<< import com.ning.billing.account.api.IAccount; ======= import com.ning.billing.account.api.AccountData; import com.ning.billing.catalog.api.BillingPeriod; >>>>>>> <<<<<<< import com.ning.billing.entitlement.api.user.Subscription; import com.ning.billing.entitlement.api.user.SubscriptionBundle; import com.ning.billing.entitlement.api.user.EntitlementUserApi; ======= >>>>>>>
<<<<<<< import com.google.common.base.Predicate; import com.google.common.collect.Iterables; import com.google.inject.Inject; ======= import java.util.List; import java.util.concurrent.atomic.AtomicLong; import java.util.regex.Pattern; import javax.annotation.Nullable; >>>>>>> import com.google.common.base.Predicate; import com.google.common.collect.Iterables; import com.google.inject.Inject; import java.util.List; import java.util.concurrent.atomic.AtomicLong; import java.util.regex.Pattern; import javax.annotation.Nullable; <<<<<<< final CatalogOverridePlanDefinitionModelDao overriddenPlan = overrideDao.getOrCreateOverridePlanDefinition(parentPlan, catalogEffectiveDate, resolvedOverride, context); final String planName = new StringBuffer(parentPlan.getName()).append("-").append(overriddenPlan.getRecordId()).toString(); ======= final String planName; if (context != null) { final CatalogOverridePlanDefinitionModelDao overriddenPlan = overrideDao.getOrCreateOverridePlanDefinition(parentPlan.getName(), catalogEffectiveDate, resolvedOverride, context); planName = new StringBuffer(parentPlan.getName()).append("-").append(overriddenPlan.getRecordId()).toString(); } else { planName = new StringBuffer(parentPlan.getName()).append("-dryrun-").append(DRY_RUN_PLAN_IDX.incrementAndGet()).toString(); } >>>>>>> final String planName; if (context != null) { final CatalogOverridePlanDefinitionModelDao overriddenPlan = overrideDao.getOrCreateOverridePlanDefinition(parentPlan, catalogEffectiveDate, resolvedOverride, context); planName = new StringBuffer(parentPlan.getName()).append("-").append(overriddenPlan.getRecordId()).toString(); } else { planName = new StringBuffer(parentPlan.getName()).append("-dryrun-").append(DRY_RUN_PLAN_IDX.incrementAndGet()).toString(); }
<<<<<<< ======= >>>>>>> <<<<<<< ======= >>>>>>> <<<<<<< ======= import org.joda.time.DateTime; import org.slf4j.Logger; import org.slf4j.LoggerFactory; >>>>>>>
<<<<<<< ======= >>>>>>> <<<<<<< assertEquals(invoices.size(), 2); busHandler.pushExpectedEvent(NextEvent.PHASE); ======= assertEquals(invoices.size(),2); for (int i = 0; i < 5; i++) { log.info("============== loop number " + i +"======================="); busHandler.pushExpectedEvent(NextEvent.INVOICE); busHandler.pushExpectedEvent(NextEvent.PAYMENT); clock.addDeltaFromReality(AT_LEAST_ONE_MONTH_MS); assertTrue(busHandler.isCompleted(DELAY)); } >>>>>>> assertEquals(invoices.size(),2); for (int i = 0; i < 5; i++) { log.info("============== loop number " + i +"======================="); busHandler.pushExpectedEvent(NextEvent.INVOICE); busHandler.pushExpectedEvent(NextEvent.PAYMENT); clock.addDeltaFromReality(AT_LEAST_ONE_MONTH_MS); assertTrue(busHandler.isCompleted(DELAY)); } <<<<<<< assertEquals(invoices.size(), 3); ======= assertEquals(invoices.size(),14); >>>>>>> assertEquals(invoices.size(),14);
<<<<<<< import org.killbill.billing.client.KillBillClientException; ======= import org.killbill.billing.beatrix.integration.db.TestDBRouterAPI; import org.killbill.billing.client.KillBillClient; >>>>>>> import org.killbill.billing.beatrix.integration.db.TestDBRouterAPI; import org.killbill.billing.client.KillBillClientException; <<<<<<< import com.google.common.io.Files; import com.google.common.io.Resources; ======= import com.google.inject.Binder; >>>>>>> import com.google.common.io.Files; import com.google.common.io.Resources; import com.google.inject.Binder;
<<<<<<< import com.ning.billing.util.tag.DefaultTagDefinition; import com.ning.billing.util.tag.Tag; import com.ning.billing.util.tag.TagDefinition; ======= >>>>>>> <<<<<<< String locale = "EN-US"; DateTimeZone timeZone = DateTimeZone.forID("America/Los_Angeles"); ======= DateTime createdDate = new DateTime(DateTimeZone.UTC); DateTime updatedDate = new DateTime(DateTimeZone.UTC); >>>>>>> String locale = "EN-US"; DateTimeZone timeZone = DateTimeZone.forID("America/Los_Angeles"); DateTime createdDate = new DateTime(DateTimeZone.UTC); DateTime updatedDate = new DateTime(DateTimeZone.UTC); <<<<<<< return new AccountBuilder().externalKey(thisKey).name(name).phone(phone).firstNameLength(firstNameLength) .email(thisEmail).currency(Currency.USD).locale(locale) .timeZone(timeZone).build(); ======= return new AccountBuilder().externalKey(thisKey) .name(name) .phone(phone) .firstNameLength(firstNameLength) .email(thisEmail) .currency(Currency.USD) .createdDate(createdDate) .updatedDate(updatedDate) .build(); >>>>>>> return new AccountBuilder().externalKey(thisKey) .name(name) .phone(phone) .firstNameLength(firstNameLength) .email(thisEmail) .currency(Currency.USD) .locale(locale) .timeZone(timeZone) .createdDate(createdDate) .updatedDate(updatedDate) .build(); <<<<<<< @Override public DateTimeZone getTimeZone() { return DateTimeZone.forID("Australia/Darwin"); } @Override public String getLocale() { return "FR-CA"; } @Override public String getAddress1() { return null; } @Override public String getAddress2() { return null; } @Override public String getCompanyName() { return null; } @Override public String getCity() { return null; } @Override public String getStateOrProvince() { return null; } @Override public String getPostalCode() { return null; } @Override public String getCountry() { return null; } ======= >>>>>>> @Override public DateTimeZone getTimeZone() { return DateTimeZone.forID("Australia/Darwin"); } @Override public String getLocale() { return "FR-CA"; } @Override public String getAddress1() { return null; } @Override public String getAddress2() { return null; } @Override public String getCompanyName() { return null; } @Override public String getCity() { return null; } @Override public String getStateOrProvince() { return null; } @Override public String getPostalCode() { return null; } @Override public String getCountry() { return null; }
<<<<<<< final String apiKeyTenant1 = "pierre"; final String apiSecretTenant1 = "pierreIsFr3nch"; loginTenant(apiKeyTenant1, apiSecretTenant1); final Tenant tenant1 = new Tenant(); tenant1.setApiKey(apiKeyTenant1); tenant1.setApiSecret(apiSecretTenant1); tenantApi.createTenant(tenant1, requestOptions); ======= final Tenant tenant1 = createTenant("pierre", "pierreIsFr3nch", true); >>>>>>> final Tenant tenant1 = createTenant("pierre", "pierreIsFr3nch", true); <<<<<<< final String apiKeyTenant2 = "stephane"; final String apiSecretTenant2 = "stephane1sAlsoFr3nch"; loginTenant(apiKeyTenant2, apiSecretTenant2); final Tenant tenant2 = new Tenant(); tenant2.setApiKey(apiKeyTenant2); tenant2.setApiSecret(apiSecretTenant2); tenantApi.createTenant(tenant2, requestOptions); ======= createTenant("stephane", "stephane1sAlsoFr3nch", true); >>>>>>> createTenant("stephane", "stephane1sAlsoFr3nch", true); <<<<<<< loginTenant(apiKeyTenant1, apiSecretTenant1); Assert.assertNull(accountApi.getAccountByKey(account2.getExternalKey(), requestOptions)); ======= loginTenant(tenant1.getApiKey(), tenant1.getApiSecret()); Assert.assertNull(killBillClient.getAccount(account2.getExternalKey())); >>>>>>> loginTenant(tenant1.getApiKey(), tenant1.getApiSecret()); Assert.assertNull(accountApi.getAccountByKey(account2.getExternalKey(), requestOptions));
<<<<<<< ======= import com.ning.billing.dbi.MysqlTestingHelper; >>>>>>>
<<<<<<< import com.ning.billing.entitlement.glue.CatalogModuleMock; import com.ning.billing.entitlement.glue.EngineModuleSqlMock; import org.testng.annotations.Test; ======= import com.ning.billing.entitlement.glue.MockEngineModuleSql; >>>>>>> import com.ning.billing.entitlement.glue.MockEngineModuleSql; import org.testng.annotations.Test;
<<<<<<< import org.killbill.billing.client.model.gen.Account; import org.killbill.billing.client.model.gen.Tenant; import org.killbill.billing.client.model.gen.TenantKeyValue; ======= import org.killbill.billing.client.model.TenantKey; import org.killbill.billing.notification.plugin.api.ExtBusEventType; >>>>>>> import org.killbill.billing.client.model.gen.Account; import org.killbill.billing.client.model.gen.TenantKeyValue; import org.killbill.billing.notification.plugin.api.ExtBusEventType; <<<<<<< final String apiKeyTenant1 = "tenantSuperTuned"; final String apiSecretTenant1 = "2367$$ffr79"; loginTenant(apiKeyTenant1, apiSecretTenant1); final Tenant tenant1 = new Tenant(); tenant1.setApiKey(apiKeyTenant1); tenant1.setApiSecret(apiSecretTenant1); tenantApi.createTenant(tenant1, true, requestOptions); ======= createTenant("tenantSuperTuned", "2367$$ffr79", true); >>>>>>> createTenant("tenantSuperTuned", "2367$$ffr79", true); <<<<<<< final TenantKeyValue tenantKey = tenantApi.uploadPerTenantConfiguration(perTenantConfig, requestOptions); ======= callbackServlet.pushExpectedEvent(ExtBusEventType.TENANT_CONFIG_CHANGE); final TenantKey tenantKey = killBillClient.postConfigurationPropertiesForTenant(perTenantConfig, requestOptions); callbackServlet.assertListenerStatus(); >>>>>>> callbackServlet.pushExpectedEvent(ExtBusEventType.TENANT_CONFIG_CHANGE); final TenantKeyValue tenantKey = tenantApi.uploadPerTenantConfiguration(perTenantConfig, requestOptions); callbackServlet.assertListenerStatus(); <<<<<<< tenantApi.deletePerTenantConfiguration(requestOptions); // org.killbill.tenant.broadcast.rate has been set to 1s crappyWaitForLackOfProperSynchonization(2000); ======= callbackServlet.pushExpectedEvents(ExtBusEventType.TENANT_CONFIG_DELETION); killBillClient.unregisterConfigurationForTenant(requestOptions); callbackServlet.assertListenerStatus(); >>>>>>> callbackServlet.pushExpectedEvents(ExtBusEventType.TENANT_CONFIG_DELETION); tenantApi.deletePerTenantConfiguration(requestOptions); callbackServlet.assertListenerStatus(); <<<<<<< Awaitility.await() .atMost(4, TimeUnit.SECONDS) .pollInterval(Duration.ONE_SECOND) .until(new Callable<Boolean>() { @Override public Boolean call() throws Exception { return accountApi.getPaymentsForAccount(accountJson.getAccountId(), NULL_PLUGIN_PROPERTIES, requestOptions).get(0).getTransactions().size() == 2; } }); final Payments payments2 = accountApi.getPaymentsForAccount(accountJson.getAccountId(), NULL_PLUGIN_PROPERTIES, requestOptions); ======= final Payments payments2 = killBillClient.getPaymentsForAccount(accountJson.getAccountId()); >>>>>>> final Payments payments2 = accountApi.getPaymentsForAccount(accountJson.getAccountId(), NULL_PLUGIN_PROPERTIES, requestOptions); <<<<<<< Awaitility.await() .atMost(4, TimeUnit.SECONDS) .pollInterval(Duration.ONE_SECOND) .until(new Callable<Boolean>() { @Override public Boolean call() throws Exception { return accountApi.getPaymentsForAccount(accountJson.getAccountId(), NULL_PLUGIN_PROPERTIES, requestOptions).get(0).getTransactions().size() == 3; } }); final Payments payments4 = accountApi.getPaymentsForAccount(accountJson.getAccountId(), NULL_PLUGIN_PROPERTIES, requestOptions); ======= final Payments payments4 = killBillClient.getPaymentsForAccount(accountJson.getAccountId()); >>>>>>> final Payments payments4 = accountApi.getPaymentsForAccount(accountJson.getAccountId(), NULL_PLUGIN_PROPERTIES, requestOptions);
<<<<<<< expectedValue = FOURTEEN.divide(NINETY, KillBillMoney.ROUNDING_METHOD); ======= // 75 is number of days between phaseChangeDate and next billing cycle date (2011, 5, 10) // 89 is total number of days between the next and previous billing period (2011, 2, 10) -> (2011, 5, 10) expectedValue = SEVENTY_FIVE.divide(EIGHTY_NINE, NUMBER_OF_DECIMALS, ROUNDING_METHOD); >>>>>>> // 75 is number of days between phaseChangeDate and next billing cycle date (2011, 5, 10) // 89 is total number of days between the next and previous billing period (2011, 2, 10) -> (2011, 5, 10) expectedValue = SEVENTY_FIVE.divide(EIGHTY_NINE, KillBillMoney.ROUNDING_METHOD); <<<<<<< public void testSinglePlan_WithPhaseChange_BeforeBillCycleDay() throws InvalidDateSequenceException { final LocalDate startDate = invoiceUtil.buildDate(2011, 2, 3); final LocalDate phaseChangeDate = invoiceUtil.buildDate(2011, 2, 17); final LocalDate targetDate = invoiceUtil.buildDate(2011, 3, 1); BigDecimal expectedValue; expectedValue = FOURTEEN.divide(EIGHTY_NINE, KillBillMoney.ROUNDING_METHOD); testCalculateNumberOfBillingCycles(startDate, phaseChangeDate, targetDate, 3, expectedValue); expectedValue = FOURTEEN.divide(NINETY, KillBillMoney.ROUNDING_METHOD); testCalculateNumberOfBillingCycles(phaseChangeDate, targetDate, 3, expectedValue); } @Test(groups = "fast") ======= >>>>>>> <<<<<<< expectedValue = FOURTEEN.divide(NINETY, KillBillMoney.ROUNDING_METHOD).add(ONE); ======= expectedValue = ONE.add(SEVENTY_FIVE.divide(EIGHTY_NINE, NUMBER_OF_DECIMALS, ROUNDING_METHOD)); >>>>>>> expectedValue = ONE.add(SEVENTY_FIVE.divide(EIGHTY_NINE, KillBillMoney.ROUNDING_METHOD)); <<<<<<< expectedValue = FOURTEEN.divide(NINETY, KillBillMoney.ROUNDING_METHOD).add(ONE); ======= expectedValue = SEVENTY_FIVE.divide(EIGHTY_NINE, NUMBER_OF_DECIMALS, ROUNDING_METHOD).add(ONE); >>>>>>> expectedValue = SEVENTY_FIVE.divide(EIGHTY_NINE, KillBillMoney.ROUNDING_METHOD).add(ONE); <<<<<<< expectedValue = SEVEN.divide(NINETY_TWO, KillBillMoney.ROUNDING_METHOD); expectedValue = expectedValue.add(ONE); expectedValue = expectedValue.add(THREE.divide(NINETY_TWO, KillBillMoney.ROUNDING_METHOD)); ======= // startDate, 2011, 4, 7 -> 66 days out of 2011, 1, 7, 2011, 4, 7 -> 90 expectedValue = new BigDecimal("66.00").divide(NINETY, 2 * NUMBER_OF_DECIMALS, ROUNDING_METHOD); // 2011, 1, 7, planChangeDate-> 33 days out of 2011, 4, 7, 2011, 7, 7 -> 89 expectedValue = expectedValue.add(new BigDecimal("33.00").divide(NINETY_ONE, 2 * NUMBER_OF_DECIMALS, ROUNDING_METHOD)).setScale(NUMBER_OF_DECIMALS, ROUNDING_METHOD); >>>>>>> // startDate, 2011, 4, 7 -> 66 days out of 2011, 1, 7, 2011, 4, 7 -> 90 expectedValue = SIXTY_SIX.divide(NINETY, KillBillMoney.ROUNDING_METHOD); // 2011, 1, 7, planChangeDate-> 33 days out of 2011, 4, 7, 2011, 7, 7 -> 89 expectedValue = expectedValue.add(THIRTY_THREE.divide(NINETY_ONE, KillBillMoney.ROUNDING_METHOD)); <<<<<<< expectedValue = FIVE.divide(EIGHTY_NINE, KillBillMoney.ROUNDING_METHOD).add(ONE); ======= expectedValue = FIVE.divide(EIGHTY_NINE, NUMBER_OF_DECIMALS, ROUNDING_METHOD).add(ONE).setScale(NUMBER_OF_DECIMALS, ROUNDING_METHOD); >>>>>>> expectedValue = FIVE.divide(EIGHTY_NINE, KillBillMoney.ROUNDING_METHOD).add(ONE);
<<<<<<< import org.killbill.billing.catalog.api.PriceListSet; import org.killbill.billing.catalog.api.ProductCategory; import org.killbill.billing.client.RequestOptions; import org.killbill.billing.client.model.gen.Account; import org.killbill.billing.client.model.gen.PaymentMethod; import org.killbill.billing.client.model.gen.PaymentMethodPluginDetail; import org.killbill.billing.client.model.gen.Subscription; import org.killbill.billing.client.model.gen.Tenant; ======= import org.killbill.billing.client.model.Account; import org.killbill.billing.client.model.Tenant; import org.killbill.billing.notification.plugin.api.ExtBusEventType; >>>>>>> import org.killbill.billing.client.model.gen.Account; import org.killbill.billing.client.model.gen.Tenant; import org.killbill.billing.notification.plugin.api.ExtBusEventType; <<<<<<< final String testApiKey = "testApiKey"; final String testApiSecret = "testApiSecret"; final Tenant tenant = new Tenant(); tenant.setApiKey(testApiKey); tenant.setApiSecret(testApiSecret); loginTenant(testApiKey, testApiSecret); Tenant currentTenant = tenantApi.createTenant(tenant, false, requestOptions); // using custom RequestOptions with the new Tenant created before RequestOptions inputOptions = RequestOptions.builder() .withCreatedBy(createdBy) .withReason(reason) .withComment(comment) .withTenantApiKey(currentTenant.getApiKey()) .withTenantApiSecret(currentTenant.getApiSecret()) .build(); ======= final Tenant currentTenant = createTenant("testApiKey", "testApiSecret", false); >>>>>>> final Tenant currentTenant = createTenant("testApiKey", "testApiSecret", false); <<<<<<< final String catalogPath = Resources.getResource("SpyCarAdvanced.xml").getPath(); final File catalogFile = new File(catalogPath); final String body = Files.toString(catalogFile, Charset.forName("UTF-8")); catalogApi.uploadCatalogXml(body, inputOptions); ======= callbackServlet.pushExpectedEvent(ExtBusEventType.TENANT_CONFIG_CHANGE); killBillClient.uploadXMLCatalog(Resources.getResource("SpyCarAdvanced.xml").getPath(), requestOptions); callbackServlet.assertListenerStatus(); >>>>>>> callbackServlet.pushExpectedEvent(ExtBusEventType.TENANT_CONFIG_CHANGE); final String catalogPath = Resources.getResource("SpyCarAdvanced.xml").getPath(); final File catalogFile = new File(catalogPath); final String body = Files.toString(catalogFile, Charset.forName("UTF-8")); catalogApi.uploadCatalogXml(body, requestOptions); callbackServlet.assertListenerStatus(); <<<<<<< //assertTrue(hasKeysByTenantRecordId(tenantPaymentStateMachineConfigCache, tenantRecordId.toString())); assertTrue(tenantCache.isKeyInCache(testApiKey)); ======= assertTrue(hasKeysByTenantRecordId(tenantPaymentStateMachineConfigCache, tenantRecordId.toString())); assertTrue(tenantCache.isKeyInCache(currentTenant.getApiKey())); >>>>>>> assertTrue(hasKeysByTenantRecordId(tenantPaymentStateMachineConfigCache, tenantRecordId.toString())); assertTrue(tenantCache.isKeyInCache(currentTenant.getApiKey())); <<<<<<< adminApi.invalidatesCache(null, inputOptions); ======= killBillClient.invalidateCacheByTenant(requestOptions); >>>>>>> adminApi.invalidatesCache(null, requestOptions); <<<<<<< //assertFalse(hasKeysByTenantRecordId(tenantPaymentStateMachineConfigCache, tenantRecordId.toString())); assertFalse(tenantCache.isKeyInCache(testApiKey)); ======= assertFalse(hasKeysByTenantRecordId(tenantPaymentStateMachineConfigCache, tenantRecordId.toString())); assertFalse(tenantCache.isKeyInCache(currentTenant.getApiKey())); >>>>>>> assertFalse(hasKeysByTenantRecordId(tenantPaymentStateMachineConfigCache, tenantRecordId.toString())); assertFalse(tenantCache.isKeyInCache(currentTenant.getApiKey())); <<<<<<< private void createAccountWithPMBundleAndSubscriptionAndWaitForFirstInvoiceWithInputOptions(final RequestOptions inputOptions) throws Exception { Account account = accountApi.createAccount(getAccount(), inputOptions); final PaymentMethodPluginDetail info = new PaymentMethodPluginDetail(); info.setProperties(null); final PaymentMethod paymentMethodJson = new PaymentMethod(null, UUID.randomUUID().toString(), account.getAccountId(), true, PLUGIN_NAME, info, null); accountApi.createPaymentMethod(account.getAccountId(), paymentMethodJson, NULL_PLUGIN_NAMES, NULL_PLUGIN_PROPERTIES, inputOptions); final Subscription subscription = new Subscription(); subscription.setAccountId(account.getAccountId()); subscription.setExternalKey(UUID.randomUUID().toString()); subscription.setProductName("Sports"); subscription.setProductCategory(ProductCategory.BASE); subscription.setBillingPeriod(BillingPeriod.MONTHLY); subscription.setPriceList(PriceListSet.DEFAULT_PRICELIST_NAME); clock.resetDeltaFromReality(); clock.setDay(new LocalDate(2013, 3, 1)); final Subscription subscriptionJson = subscriptionApi.createSubscription(subscription, null, null, null, NULL_PLUGIN_PROPERTIES, inputOptions); assertNotNull(subscriptionJson); clock.addDays(32); crappyWaitForLackOfProperSynchonization(); } ======= >>>>>>>
<<<<<<< EventQueue.invokeLater(new Runnable() { public void run() { ((WFramePeer)getPeer()).emulateActivation(true); } }); ======= Runnable r = new Runnable() { public void run() { ((WEmbeddedFramePeer)getPeer()).synthesizeWmActivate(true); } }; WToolkit.postEvent(WToolkit.targetToAppContext(this), new InvocationEvent(this, r)); >>>>>>> Runnable r = new Runnable() { public void run() { ((WFramePeer)getPeer()).emulateActivation(true); } }; WToolkit.postEvent(WToolkit.targetToAppContext(this), new InvocationEvent(this, r));
<<<<<<< ======= import org.killbill.billing.client.model.Account; import org.killbill.billing.client.model.AuditLog; import org.killbill.billing.client.model.Subscription; import org.killbill.billing.client.model.Tag; import org.killbill.billing.client.model.TagDefinition; >>>>>>>
<<<<<<< import org.killbill.billing.client.model.gen.Account; import org.killbill.billing.client.model.gen.AuditLog; import org.killbill.billing.client.model.gen.PaymentMethod; import org.killbill.billing.client.model.gen.PaymentMethodPluginDetail; import org.killbill.billing.client.model.gen.PluginProperty; import org.killbill.billing.client.model.gen.Subscription; ======= import org.killbill.billing.notification.plugin.api.ExtBusEventType; >>>>>>> import org.killbill.billing.client.model.gen.Account; import org.killbill.billing.client.model.gen.AuditLog; import org.killbill.billing.client.model.gen.PaymentMethod; import org.killbill.billing.client.model.gen.PaymentMethodPluginDetail; import org.killbill.billing.client.model.gen.PluginProperty; import org.killbill.billing.client.model.gen.Subscription; import org.killbill.billing.notification.plugin.api.ExtBusEventType; <<<<<<< final PaymentMethod paymentMethodJson = new PaymentMethod(null, externalkey, input.getAccountId(), true, PLUGIN_NAME, info, EMPTY_AUDIT_LOGS); accountApi.createPaymentMethod(input.getAccountId(), paymentMethodJson, true, false, NULL_PLUGIN_NAMES, NULL_PLUGIN_PROPERTIES, requestOptions); return accountApi.getAccount(input.getAccountId(), requestOptions); ======= final PaymentMethod paymentMethodJson = new PaymentMethod(null, externalkey, input.getAccountId(), true, PLUGIN_NAME, info); killBillClient.createPaymentMethod(paymentMethodJson, createdBy, reason, comment); callbackServlet.assertListenerStatus(); return killBillClient.getAccount(input.getExternalKey()); >>>>>>> final PaymentMethod paymentMethodJson = new PaymentMethod(null, externalkey, input.getAccountId(), true, PLUGIN_NAME, info, EMPTY_AUDIT_LOGS); accountApi.createPaymentMethod(input.getAccountId(), paymentMethodJson, true, false, NULL_PLUGIN_NAMES, NULL_PLUGIN_PROPERTIES, requestOptions); callbackServlet.assertListenerStatus(); return accountApi.getAccount(input.getAccountId(), requestOptions); <<<<<<< isDefault, ExternalPaymentProviderPlugin.PLUGIN_NAME, info, EMPTY_AUDIT_LOGS); return accountApi.createPaymentMethod(input.getAccountId(), paymentMethodJson, NULL_PLUGIN_NAMES, NULL_PLUGIN_PROPERTIES, requestOptions); ======= isDefault, ExternalPaymentProviderPlugin.PLUGIN_NAME, info); final PaymentMethod paymentMethod = killBillClient.createPaymentMethod(paymentMethodJson, requestOptions); callbackServlet.assertListenerStatus(); return paymentMethod; >>>>>>> isDefault, ExternalPaymentProviderPlugin.PLUGIN_NAME, info, EMPTY_AUDIT_LOGS); callbackServlet.assertListenerStatus(); return accountApi.createPaymentMethod(input.getAccountId(), paymentMethodJson, NULL_PLUGIN_NAMES, NULL_PLUGIN_PROPERTIES, requestOptions); <<<<<<< return accountApi.createAccount(input, requestOptions); ======= final Account account = killBillClient.createAccount(input, createdBy, reason, comment); callbackServlet.assertListenerStatus(); return account; >>>>>>> final Account account = accountApi.createAccount(input, requestOptions); callbackServlet.assertListenerStatus(); return account; <<<<<<< return subscriptionApi.createSubscription(input, null, null, true, false, null, waitCompletion, waitCompletion ? DEFAULT_WAIT_COMPLETION_TIMEOUT_SEC : -1L, NULL_PLUGIN_PROPERTIES, requestOptions); ======= final Subscription subscription = killBillClient.createSubscription(input, null, null, waitCompletion ? DEFAULT_WAIT_COMPLETION_TIMEOUT_SEC : -1, false, requestOptions); callbackServlet.assertListenerStatus(); return subscription; >>>>>>> final Subscription subscription = subscriptionApi.createSubscription(input, null, null, true, false, null, waitCompletion, waitCompletion ? DEFAULT_WAIT_COMPLETION_TIMEOUT_SEC : -1L, NULL_PLUGIN_PROPERTIES, requestOptions); callbackServlet.assertListenerStatus(); return subscription; <<<<<<< final Subscription subscriptionJson = createSubscription(accountJson.getAccountId(), UUID.randomUUID().toString(), "Shotgun", ======= final Subscription subscriptionJson = createEntitlement(accountJson.getAccountId(), UUID.randomUUID().toString(), productName, >>>>>>> final Subscription subscriptionJson = createSubscription(accountJson.getAccountId(), UUID.randomUUID().toString(), productName, <<<<<<< final Tags accountTag = accountApi.createAccountTags(accountJson.getAccountId(), ImmutableList.<UUID>of(ControlTagType.MANUAL_PAY.getId()), requestOptions); ======= callbackServlet.pushExpectedEvent(ExtBusEventType.TAG_CREATION); final Tags accountTag = killBillClient.createAccountTag(accountJson.getAccountId(), ControlTagType.MANUAL_PAY.getId(), requestOptions); callbackServlet.assertListenerStatus(); >>>>>>> callbackServlet.pushExpectedEvent(ExtBusEventType.TAG_CREATION); final Tags accountTag = accountApi.createAccountTags(accountJson.getAccountId(), ImmutableList.<UUID>of(ControlTagType.MANUAL_PAY.getId()), requestOptions); callbackServlet.assertListenerStatus();
<<<<<<< ======= import java.util.Collections; import java.util.HashMap; import java.util.LinkedHashMap; import java.util.List; >>>>>>> import java.util.Collections; import java.util.HashMap; import java.util.LinkedHashMap; import java.util.List; <<<<<<< ======= import org.killbill.billing.client.model.Account; import org.killbill.billing.client.model.AuditLog; import org.killbill.billing.client.model.ComboPaymentTransaction; >>>>>>>
<<<<<<< final PaymentInfoEvent payment = paymentApi.getLastPaymentInfo(invoiceIds); lastPaymentStatus = payment.getStatus(); paymentMethod = payment.getPaymentMethod(); creditCardType = payment.getCardType(); billingAddressCountry = payment.getCardCountry(); bac.setLastPaymentStatus(lastPaymentStatus); bac.setPaymentMethod(paymentMethod); bac.setCreditCardType(creditCardType); bac.setBillingAddressCountry(billingAddressCountry); bac.setLastInvoiceDate(lastInvoiceDate); bac.setTotalInvoiceBalance(totalInvoiceBalance); bac.setBalance(invoiceUserApi.getAccountBalance(account.getId())); } catch (PaymentApiException ex) { log.error(String.format("Failed to handle acount update for account %s", account.getId()), ex); ======= try { final PaymentInfoEvent payment = paymentApi.getLastPaymentInfo(invoiceIds); if (payment != null) { lastPaymentStatus = payment.getStatus(); paymentMethod = payment.getPaymentMethod(); creditCardType = payment.getCardType(); billingAddressCountry = payment.getCardCountry(); } bac.setLastPaymentStatus(lastPaymentStatus); bac.setPaymentMethod(paymentMethod); bac.setCreditCardType(creditCardType); bac.setBillingAddressCountry(billingAddressCountry); bac.setLastInvoiceDate(lastInvoiceDate); bac.setTotalInvoiceBalance(totalInvoiceBalance); bac.setBalance(invoiceUserApi.getAccountBalance(account.getId())); } catch (PaymentApiException ex) { // TODO: handle this exception } >>>>>>> final PaymentInfoEvent payment = paymentApi.getLastPaymentInfo(invoiceIds); if (payment != null) { lastPaymentStatus = payment.getStatus(); paymentMethod = payment.getPaymentMethod(); creditCardType = payment.getCardType(); } billingAddressCountry = payment.getCardCountry(); bac.setLastPaymentStatus(lastPaymentStatus); bac.setPaymentMethod(paymentMethod); bac.setCreditCardType(creditCardType); bac.setBillingAddressCountry(billingAddressCountry); bac.setLastInvoiceDate(lastInvoiceDate); bac.setTotalInvoiceBalance(totalInvoiceBalance); bac.setBalance(invoiceUserApi.getAccountBalance(account.getId())); } catch (PaymentApiException ex) { log.error(String.format("Failed to handle acount update for account %s", account.getId()), ex);
<<<<<<< * @bug 4273454 7054918 * @library ../testlibrary ======= * @bug 4273454 7052537 >>>>>>> * @bug 4273454 7054918 7052537 * @library ../testlibrary
<<<<<<< ======= import java.lang.Thread.UncaughtExceptionHandler; import java.util.ArrayList; import java.util.Collection; import java.util.LinkedList; import java.util.List; import java.util.UUID; import java.util.concurrent.Executor; import java.util.concurrent.Executors; import java.util.concurrent.ThreadFactory; import java.util.concurrent.atomic.AtomicInteger; import org.slf4j.Logger; import org.slf4j.LoggerFactory; >>>>>>> <<<<<<< import com.ning.billing.config.IEntitlementConfig; import com.ning.billing.entitlement.engine.dao.IEntitlementDao; import com.ning.billing.entitlement.events.IEvent; import com.ning.billing.util.clock.IClock; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.lang.Thread.UncaughtExceptionHandler; import java.util.*; import java.util.concurrent.Executor; import java.util.concurrent.Executors; import java.util.concurrent.ThreadFactory; import java.util.concurrent.atomic.AtomicInteger; ======= import com.ning.billing.config.EntitlementConfig; import com.ning.billing.entitlement.engine.dao.EntitlementDao; import com.ning.billing.entitlement.events.EntitlementEvent; import com.ning.billing.util.clock.Clock; >>>>>>> import com.ning.billing.config.EntitlementConfig; import com.ning.billing.entitlement.engine.dao.EntitlementDao; import com.ning.billing.entitlement.events.EntitlementEvent; import com.ning.billing.util.clock.Clock; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.lang.Thread.UncaughtExceptionHandler; import java.util.*; import java.util.concurrent.Executor; import java.util.concurrent.Executors; import java.util.concurrent.ThreadFactory; import java.util.concurrent.atomic.AtomicInteger;
<<<<<<< import com.ning.billing.util.api.CustomFieldUserApi; ======= >>>>>>> import com.ning.billing.util.api.CustomFieldUserApi; <<<<<<< ======= >>>>>>> <<<<<<< /* * ************************* CUSTOM FIELDS ***************************** */ ======= @PUT @Consumes(APPLICATION_JSON) @Produces(APPLICATION_JSON) @Path("/{accountId:" + UUID_PATTERN + "}/" + PAYMENT_METHODS + "/{paymentMethodId:" + UUID_PATTERN + "}/" + PAYMENT_METHODS_DEFAULT_PATH_POSTFIX) public Response setDefaultPaymentMethod(@PathParam("accountId") final String accountId, @PathParam("paymentMethodId") final String paymentMethodId, @HeaderParam(HDR_CREATED_BY) final String createdBy, @HeaderParam(HDR_REASON) final String reason, @HeaderParam(HDR_COMMENT) final String comment) { try { final Account account = accountApi.getAccountById(UUID.fromString(accountId)); paymentApi.setDefaultPaymentMethod(account, UUID.fromString(paymentMethodId), context.createContext(createdBy, reason, comment)); return Response.status(Status.OK).build(); } catch (AccountApiException e) { return Response.status(Status.BAD_REQUEST).build(); } catch (PaymentApiException e) { return Response.status(Status.NOT_FOUND).build(); } catch (IllegalArgumentException e) { return Response.status(Status.BAD_REQUEST).entity(e.getMessage()).build(); } } /**************************** TAGS ******************************/ >>>>>>> @PUT @Consumes(APPLICATION_JSON) @Produces(APPLICATION_JSON) @Path("/{accountId:" + UUID_PATTERN + "}/" + PAYMENT_METHODS + "/{paymentMethodId:" + UUID_PATTERN + "}/" + PAYMENT_METHODS_DEFAULT_PATH_POSTFIX) public Response setDefaultPaymentMethod(@PathParam("accountId") final String accountId, @PathParam("paymentMethodId") final String paymentMethodId, @HeaderParam(HDR_CREATED_BY) final String createdBy, @HeaderParam(HDR_REASON) final String reason, @HeaderParam(HDR_COMMENT) final String comment) { try { final Account account = accountApi.getAccountById(UUID.fromString(accountId)); paymentApi.setDefaultPaymentMethod(account, UUID.fromString(paymentMethodId), context.createContext(createdBy, reason, comment)); return Response.status(Status.OK).build(); } catch (AccountApiException e) { return Response.status(Status.BAD_REQUEST).build(); } catch (PaymentApiException e) { return Response.status(Status.NOT_FOUND).build(); } catch (IllegalArgumentException e) { return Response.status(Status.BAD_REQUEST).entity(e.getMessage()).build(); } } /* * ************************* CUSTOM FIELDS ***************************** */
<<<<<<< DateTime createdDate) { super(id, invoiceId, subscriptionId, bundleId, planName, phaseName, startDate, endDate, amount, currency, createdDate); ======= String createdBy, DateTime createdDate) { super(id, invoiceId, accountId, subscriptionId, planName, phaseName, startDate, endDate, amount, currency, createdBy, createdDate); >>>>>>> String createdBy, DateTime createdDate) { super(id, invoiceId, accountId, bundleId, subscriptionId, planName, phaseName, startDate, endDate, amount, currency, createdBy, createdDate);
<<<<<<< @Override public void changeInvoiceStatus(final UUID invoiceId, final InvoiceStatus newState, final InternalCallContext context) throws InvoiceApiException { throw new UnsupportedOperationException(); } @Override public void createParentChildInvoiceRelation(final InvoiceParentChildModelDao invoiceRelation, final InternalCallContext context) throws InvoiceApiException { throw new UnsupportedOperationException(); } @Override public InvoiceModelDao getParentDraftInvoice(final UUID parentAccountId, final InternalCallContext context) throws InvoiceApiException { throw new UnsupportedOperationException(); } @Override public List<InvoiceParentChildModelDao> getChildInvoicesByParentInvoiceId(final UUID parentInvoiceId, final InternalCallContext context) throws InvoiceApiException { throw new UnsupportedOperationException(); } @Override public void updateInvoiceItemAmount(final UUID invoiceItemId, final BigDecimal amount, final InternalCallContext context) throws InvoiceApiException { throw new UnsupportedOperationException(); } ======= @Override public void notifyOfPaymentInit(final InvoicePaymentModelDao invoicePayment, final InternalCallContext context) { synchronized (monitor) { payments.put(invoicePayment.getId(), invoicePayment); } } >>>>>>> @Override public void notifyOfPaymentInit(final InvoicePaymentModelDao invoicePayment, final InternalCallContext context) { synchronized (monitor) { payments.put(invoicePayment.getId(), invoicePayment); } } @Override public void changeInvoiceStatus(final UUID invoiceId, final InvoiceStatus newState, final InternalCallContext context) throws InvoiceApiException { throw new UnsupportedOperationException(); } @Override public void createParentChildInvoiceRelation(final InvoiceParentChildModelDao invoiceRelation, final InternalCallContext context) throws InvoiceApiException { throw new UnsupportedOperationException(); } @Override public InvoiceModelDao getParentDraftInvoice(final UUID parentAccountId, final InternalCallContext context) throws InvoiceApiException { throw new UnsupportedOperationException(); } @Override public List<InvoiceParentChildModelDao> getChildInvoicesByParentInvoiceId(final UUID parentInvoiceId, final InternalCallContext context) throws InvoiceApiException { throw new UnsupportedOperationException(); } public void updateInvoiceItemAmount(final UUID invoiceItemId, final BigDecimal amount, final InternalCallContext context) throws InvoiceApiException { throw new UnsupportedOperationException(); }
<<<<<<< final Subscriptions body = new Subscriptions(); body.add(base); body.add(addOn); final Bundle bundle = subscriptionApi.createSubscriptionWithAddOns(body, null, null, NULL_PLUGIN_PROPERTIES, requestOptions); ======= callbackServlet.pushExpectedEvents(ExtBusEventType.ACCOUNT_CHANGE, ExtBusEventType.ENTITLEMENT_CREATION, ExtBusEventType.ENTITLEMENT_CREATION, ExtBusEventType.SUBSCRIPTION_CREATION, ExtBusEventType.SUBSCRIPTION_CREATION, ExtBusEventType.SUBSCRIPTION_CREATION, ExtBusEventType.SUBSCRIPTION_CREATION, ExtBusEventType.INVOICE_CREATION); final Bundle bundle = killBillClient.createSubscriptionWithAddOns(ImmutableList.<Subscription>of(base, addOn), null, DEFAULT_WAIT_COMPLETION_TIMEOUT_SEC, requestOptions); callbackServlet.assertListenerStatus(); >>>>>>> callbackServlet.pushExpectedEvents(ExtBusEventType.ACCOUNT_CHANGE, ExtBusEventType.ENTITLEMENT_CREATION, ExtBusEventType.ENTITLEMENT_CREATION, ExtBusEventType.SUBSCRIPTION_CREATION, ExtBusEventType.SUBSCRIPTION_CREATION, ExtBusEventType.SUBSCRIPTION_CREATION, ExtBusEventType.SUBSCRIPTION_CREATION, ExtBusEventType.INVOICE_CREATION); final Subscriptions body = new Subscriptions(); body.add(base); body.add(addOn); final Bundle bundle = subscriptionApi.createSubscriptionWithAddOns(body, null, null, NULL_PLUGIN_PROPERTIES, requestOptions); callbackServlet.assertListenerStatus(); <<<<<<< usageApi.recordUsage(usage, requestOptions); ======= killBillClient.createSubscriptionUsageRecord(usage, requestOptions); callbackServlet.assertListenerStatus(); >>>>>>> usageApi.recordUsage(usage, requestOptions); callbackServlet.assertListenerStatus(); <<<<<<< crappyWaitForLackOfProperSynchonization(); final Invoices invoices = accountApi.getInvoicesForAccount(accountJson.getAccountId(), true, false, false, false, AuditLevel.MINIMAL, requestOptions); ======= callbackServlet.assertListenerStatus(); final Invoices invoices = killBillClient.getInvoicesForAccount(accountJson.getAccountId(), true, false, false, false, AuditLevel.MINIMAL, requestOptions); >>>>>>> callbackServlet.assertListenerStatus(); final Invoices invoices = accountApi.getInvoicesForAccount(accountJson.getAccountId(), true, false, false, false, AuditLevel.MINIMAL, requestOptions);
<<<<<<< ======= import org.skife.jdbi.v2.tweak.HandleCallback; >>>>>>> <<<<<<< ======= private final Logger log = LoggerFactory.getLogger(TestNotificationQueue.class); >>>>>>> <<<<<<< ======= @Inject NotificationQueueService queueService; >>>>>>> @Inject NotificationQueueService queueService; <<<<<<< final DefaultNotificationQueue queue = new DefaultNotificationQueue(dbi, clock, "test-svc", "foo", new NotificationQueueHandler() { @Override public void handleReadyNotification(final NotificationKey notificationKey, final DateTime eventDateTime, final UUID userToken, final Long accountRecordId, final Long tenantRecordId) { synchronized (expectedNotifications) { log.info("Handler received key: " + notificationKey); expectedNotifications.put(notificationKey, Boolean.TRUE); expectedNotifications.notify(); } } }, getNotificationConfig(false, 100, 1, 10000), new InternalCallContextFactory(dbi, clock)); ======= final NotificationQueue queue = queueService.createNotificationQueue("test-svc", "foo", new NotificationQueueHandler() { @Override public void handleReadyNotification(final NotificationKey notificationKey, final DateTime eventDateTime, final Long accountRecordId, final Long tenantRecordId) { synchronized (expectedNotifications) { log.info("Handler received key: " + notificationKey); expectedNotifications.put(notificationKey, Boolean.TRUE); expectedNotifications.notify(); } } }); >>>>>>> final NotificationQueue queue = queueService.createNotificationQueue("test-svc", "foo", new NotificationQueueHandler() { @Override public void handleReadyNotification(final NotificationKey notificationKey, final DateTime eventDateTime, final UUID userToken, final Long accountRecordId, final Long tenantRecordId) { synchronized (expectedNotifications) { log.info("Handler received key: " + notificationKey); expectedNotifications.put(notificationKey, Boolean.TRUE); expectedNotifications.notify(); } } }); <<<<<<< final DefaultNotificationQueue queue = new DefaultNotificationQueue(dbi, clock, "test-svc", "many", new NotificationQueueHandler() { @Override public void handleReadyNotification(final NotificationKey notificationKey, final DateTime eventDateTime, final UUID userToken, final Long accountRecordId, final Long tenantRecordId) { synchronized (expectedNotifications) { expectedNotifications.put(notificationKey, Boolean.TRUE); expectedNotifications.notify(); } } }, getNotificationConfig(false, 100, 10, 10000), new InternalCallContextFactory(dbi, clock)); ======= final NotificationQueue queue = queueService.createNotificationQueue("test-svc", "many", new NotificationQueueHandler() { @Override public void handleReadyNotification(final NotificationKey notificationKey, final DateTime eventDateTime, final Long accountRecordId, final Long tenantRecordId) { synchronized (expectedNotifications) { log.info("Handler received key: " + notificationKey.toString()); expectedNotifications.put(notificationKey, Boolean.TRUE); expectedNotifications.notify(); } } }); >>>>>>> final NotificationQueue queue = queueService.createNotificationQueue("test-svc", "many", new NotificationQueueHandler() { @Override public void handleReadyNotification(final NotificationKey notificationKey, final DateTime eventDateTime, final UUID userToken, final Long accountRecordId, final Long tenantRecordId) { synchronized (expectedNotifications) { log.info("Handler received key: " + notificationKey.toString()); expectedNotifications.put(notificationKey, Boolean.TRUE); expectedNotifications.notify(); } } }); <<<<<<< final DefaultNotificationQueue queue = new DefaultNotificationQueue(dbi, clock, "test-svc", "many", new NotificationQueueHandler() { @Override public void handleReadyNotification(final NotificationKey inputKey, final DateTime eventDateTime, final UUID userToken, final Long accountRecordId, final Long tenantRecordId) { if (inputKey.equals(notificationKey) || inputKey.equals(notificationKey2)) { //ignore stray events from other tests log.info("Received notification with key: " + notificationKey); eventsReceived++; } } }, getNotificationConfig(false, 100, 10, 10000), new InternalCallContextFactory(dbi, clock)); ======= >>>>>>>
<<<<<<< import java.util.Iterator; import java.util.List; ======= import java.util.UUID; >>>>>>> import java.util.Iterator; import java.util.List; import java.util.UUID; <<<<<<< DefaultEntitlementMigrationApi migrationApi, AddonUtils addonUtils, EventBus eventBus) { ======= DefaultEntitlementMigrationApi migrationApi, EventBus eventBus, NotificationQueueService notificationQueueService) { >>>>>>> DefaultEntitlementMigrationApi migrationApi, AddonUtils addonUtils, EventBus eventBus, NotificationQueueService notificationQueueService) { <<<<<<< this.addonUtils = addonUtils; ======= this.config = config; >>>>>>> this.addonUtils = addonUtils; this.config = config;
<<<<<<< ======= import java.util.Set; import java.util.UUID; >>>>>>> import java.util.Set; import java.util.UUID; <<<<<<< this.payments.add(new PaymentJson(cur.getAmount(), paidAmount, cur.getInvoiceId(), cur.getPaymentId(), cur.getCreatedDate(), cur.getUpdatedDate(), cur.getRetryCount(), cur.getCurrency().toString(), status)); ======= this.payments.add(new PaymentJsonWithBundleKeys(cur.getAmount(), paidAmount, cur.getInvoiceId().toString(), cur.getPaymentId(), cur.getCreatedDate(), cur.getUpdatedDate(), cur.getRetryCount(), cur.getCurrency().toString(), status, getBundleExternalKey(cur.getInvoiceId(), invoices, bundles))); >>>>>>> this.payments.add(new PaymentJsonWithBundleKeys(cur.getAmount(), paidAmount, cur.getInvoiceId(), cur.getPaymentId(), cur.getCreatedDate(), cur.getUpdatedDate(), cur.getRetryCount(), cur.getCurrency().toString(), status, getBundleExternalKey(cur.getInvoiceId(), invoices, bundles)));
<<<<<<< String QUERY_INCLUDED_DELETED = "includedDeleted"; ======= public static final String AUDIT_LOG = "auditLogs"; >>>>>>> String QUERY_INCLUDED_DELETED = "includedDeleted"; String AUDIT_LOG = "auditLogs";
<<<<<<< final Iterable<PluginProperty> pluginProperties = extractPluginProperties(pluginPropertiesString); final CallContext callContext = context.createCallContextNoAccountId(createdBy, reason, comment, request); ======= final Iterable<PluginProperty> pluginPropertiesFromBody = extractPluginProperties(json.getProperties()); final Iterable<PluginProperty> pluginPropertiesFromQuery = extractPluginProperties(pluginPropertiesString); final Iterable<PluginProperty> pluginProperties = Iterables.concat(pluginPropertiesFromQuery, pluginPropertiesFromBody); final CallContext callContext = context.createContext(createdBy, reason, comment, request); >>>>>>> final Iterable<PluginProperty> pluginPropertiesFromBody = extractPluginProperties(json.getProperties()); final Iterable<PluginProperty> pluginPropertiesFromQuery = extractPluginProperties(pluginPropertiesString); final Iterable<PluginProperty> pluginProperties = Iterables.concat(pluginPropertiesFromQuery, pluginPropertiesFromBody); final CallContext callContext = context.createCallContextNoAccountId(createdBy, reason, comment, request); <<<<<<< final Iterable<PluginProperty> pluginProperties = extractPluginProperties(pluginPropertiesString); final CallContext callContext = context.createCallContextNoAccountId(createdBy, reason, comment, request); ======= final Iterable<PluginProperty> pluginPropertiesFromBody = extractPluginProperties(json.getProperties()); final Iterable<PluginProperty> pluginPropertiesFromQuery = extractPluginProperties(pluginPropertiesString); final Iterable<PluginProperty> pluginProperties = Iterables.concat(pluginPropertiesFromQuery, pluginPropertiesFromBody); final CallContext callContext = context.createContext(createdBy, reason, comment, request); >>>>>>> final Iterable<PluginProperty> pluginPropertiesFromBody = extractPluginProperties(json.getProperties()); final Iterable<PluginProperty> pluginPropertiesFromQuery = extractPluginProperties(pluginPropertiesString); final Iterable<PluginProperty> pluginProperties = Iterables.concat(pluginPropertiesFromQuery, pluginPropertiesFromBody); final CallContext callContext = context.createCallContextNoAccountId(createdBy, reason, comment, request); <<<<<<< final Iterable<PluginProperty> pluginProperties = extractPluginProperties(pluginPropertiesString); final CallContext callContext = context.createCallContextNoAccountId(createdBy, reason, comment, request); ======= final Iterable<PluginProperty> pluginPropertiesFromBody = extractPluginProperties(json != null ? json.getProperties() : null); final Iterable<PluginProperty> pluginPropertiesFromQuery = extractPluginProperties(pluginPropertiesString); final Iterable<PluginProperty> pluginProperties = Iterables.concat(pluginPropertiesFromQuery, pluginPropertiesFromBody); final CallContext callContext = context.createContext(createdBy, reason, comment, request); >>>>>>> final Iterable<PluginProperty> pluginPropertiesFromBody = extractPluginProperties(json != null ? json.getProperties() : null); final Iterable<PluginProperty> pluginPropertiesFromQuery = extractPluginProperties(pluginPropertiesString); final Iterable<PluginProperty> pluginProperties = Iterables.concat(pluginPropertiesFromQuery, pluginPropertiesFromBody); final CallContext callContext = context.createCallContextNoAccountId(createdBy, reason, comment, request); <<<<<<< final Iterable<PluginProperty> pluginProperties = extractPluginProperties(pluginPropertiesString); final CallContext callContext = context.createCallContextNoAccountId(createdBy, reason, comment, request); ======= final Iterable<PluginProperty> pluginPropertiesFromBody = extractPluginProperties(json.getProperties()); final Iterable<PluginProperty> pluginPropertiesFromQuery = extractPluginProperties(pluginPropertiesString); final Iterable<PluginProperty> pluginProperties = Iterables.concat(pluginPropertiesFromQuery, pluginPropertiesFromBody); final CallContext callContext = context.createContext(createdBy, reason, comment, request); >>>>>>> final Iterable<PluginProperty> pluginPropertiesFromBody = extractPluginProperties(json.getProperties()); final Iterable<PluginProperty> pluginPropertiesFromQuery = extractPluginProperties(pluginPropertiesString); final Iterable<PluginProperty> pluginProperties = Iterables.concat(pluginPropertiesFromQuery, pluginPropertiesFromBody); final CallContext callContext = context.createCallContextNoAccountId(createdBy, reason, comment, request);
<<<<<<< ======= @JsonView(BundleTimelineViews.Base.class) >>>>>>> <<<<<<< ======= @JsonView(BundleTimelineViews.Base.class) >>>>>>> <<<<<<< ======= >>>>>>>
<<<<<<< import static javax.ws.rs.core.MediaType.APPLICATION_JSON; import java.util.ArrayList; import java.util.Collection; import java.util.LinkedList; import java.util.List; import java.util.UUID; ======= >>>>>>> import static javax.ws.rs.core.MediaType.APPLICATION_JSON; import java.util.ArrayList; import java.util.Collection; import java.util.LinkedList; import java.util.List; import java.util.UUID; <<<<<<< ======= import java.util.ArrayList; import java.util.Collection; import java.util.LinkedList; import java.util.List; import java.util.UUID; >>>>>>> <<<<<<< import com.ning.billing.util.dao.ObjectType; ======= import com.ning.billing.util.dao.ObjectType; import static javax.ws.rs.core.MediaType.APPLICATION_JSON; >>>>>>> import com.ning.billing.util.dao.ObjectType; <<<<<<< final AccountUserApi accountApi, final EntitlementUserApi entitlementApi, final InvoiceUserApi invoiceApi, final PaymentApi paymentApi, final EntitlementTimelineApi timelineApi, final CustomFieldUserApi customFieldUserApi, final TagUserApi tagUserApi, final TagHelper tagHelper, final Context context) { ======= final AccountUserApi accountApi, final EntitlementUserApi entitlementApi, final InvoiceUserApi invoiceApi, final PaymentApi paymentApi, final EntitlementTimelineApi timelineApi, final CustomFieldUserApi customFieldUserApi, final TagUserApi tagUserApi, final TagHelper tagHelper, final Context context) { >>>>>>> final AccountUserApi accountApi, final EntitlementUserApi entitlementApi, final InvoiceUserApi invoiceApi, final PaymentApi paymentApi, final EntitlementTimelineApi timelineApi, final CustomFieldUserApi customFieldUserApi, final TagUserApi tagUserApi, final TagHelper tagHelper, final Context context) { <<<<<<< ======= >>>>>>> <<<<<<< ======= >>>>>>> <<<<<<< if (e.getCode() == ErrorCode.ACCOUNT_DOES_NOT_EXIST_FOR_ID.getCode()) { return Response.status(Status.NO_CONTENT).build(); } else { log.info(String.format("Failed to update account %s with %s", accountId, json), e); return Response.status(Status.BAD_REQUEST).build(); } ======= if (e.getCode() == ErrorCode.ACCOUNT_DOES_NOT_EXIST_FOR_ID.getCode()) { return Response.status(Status.NO_CONTENT).build(); } else { log.info(String.format("Failed to update account %s with %s", accountId, json), e); return Response.status(Status.BAD_REQUEST).build(); } >>>>>>> if (e.getCode() == ErrorCode.ACCOUNT_DOES_NOT_EXIST_FOR_ID.getCode()) { return Response.status(Status.NO_CONTENT).build(); } else { log.info(String.format("Failed to update account %s with %s", accountId, json), e); return Response.status(Status.BAD_REQUEST).build(); } <<<<<<< Account account = accountApi.getAccountById(UUID.fromString(accountId)); List<Invoice> invoices = invoiceApi.getInvoicesByAccount(account.getId()); List<Payment> payments = paymentApi.getAccountPayments(UUID.fromString(accountId)); List<SubscriptionBundle> bundles = entitlementApi.getBundlesForAccount(account.getId()); List<BundleTimeline> bundlesTimeline = new LinkedList<BundleTimeline>(); for (SubscriptionBundle cur : bundles) { ======= final Account account = accountApi.getAccountById(UUID.fromString(accountId)); final List<Invoice> invoices = invoiceApi.getInvoicesByAccount(account.getId()); final List<Payment> payments = paymentApi.getAccountPayments(UUID.fromString(accountId)); final List<SubscriptionBundle> bundles = entitlementApi.getBundlesForAccount(account.getId()); final List<BundleTimeline> bundlesTimeline = new LinkedList<BundleTimeline>(); for (final SubscriptionBundle cur : bundles) { >>>>>>> final Account account = accountApi.getAccountById(UUID.fromString(accountId)); final List<Invoice> invoices = invoiceApi.getInvoicesByAccount(account.getId()); final List<Payment> payments = paymentApi.getAccountPayments(UUID.fromString(accountId)); final List<SubscriptionBundle> bundles = entitlementApi.getBundlesForAccount(account.getId()); final List<BundleTimeline> bundlesTimeline = new LinkedList<BundleTimeline>(); for (final SubscriptionBundle cur : bundles) { <<<<<<< PaymentMethod data = json.toPaymentMethod(); Account account = accountApi.getAccountById(data.getAccountId()); UUID paymentMethodId = paymentApi.addPaymentMethod(data.getPluginName(), account, isDefault, data.getPluginDetail(), context.createContext(createdBy, reason, comment)); ======= final PaymentMethod data = json.toPaymentMethod(); final Account account = accountApi.getAccountById(data.getAccountId()); final UUID paymentMethodId = paymentApi.addPaymentMethod(data.getPluginName(), account, isDefault, data.getPluginDetail(), context.createContext(createdBy, reason, comment)); >>>>>>> final PaymentMethod data = json.toPaymentMethod(); final Account account = accountApi.getAccountById(data.getAccountId()); final UUID paymentMethodId = paymentApi.addPaymentMethod(data.getPluginName(), account, isDefault, data.getPluginDetail(), context.createContext(createdBy, reason, comment)); <<<<<<< public Response getPaymentMethods(@PathParam("accountId") String accountId, @QueryParam(QUERY_PAYMENT_METHOD_PLUGIN_INFO) @DefaultValue("false") final Boolean withPluginInfo, @QueryParam(QUERY_PAYMENT_LAST4_CC) final String last4CC, @QueryParam(QUERY_PAYMENT_NAME_ON_CC) final String nameOnCC) { ======= public Response getPaymentMethods(@PathParam("accountId") final String accountId, @QueryParam(QUERY_PAYMENT_METHOD_PLUGIN_INFO) @DefaultValue("false") final Boolean withPluginInfo, @QueryParam(QUERY_PAYMENT_LAST4_CC) final String last4CC, @QueryParam(QUERY_PAYMENT_NAME_ON_CC) final String nameOnCC) { >>>>>>> public Response getPaymentMethods(@PathParam("accountId") final String accountId, @QueryParam(QUERY_PAYMENT_METHOD_PLUGIN_INFO) @DefaultValue("false") final Boolean withPluginInfo, @QueryParam(QUERY_PAYMENT_LAST4_CC) final String last4CC, @QueryParam(QUERY_PAYMENT_NAME_ON_CC) final String nameOnCC) { <<<<<<< @PathParam("paymentMethodId") final String paymentMethodId, @HeaderParam(HDR_CREATED_BY) final String createdBy, @HeaderParam(HDR_REASON) final String reason, @HeaderParam(HDR_COMMENT) final String comment) { ======= @PathParam("paymentMethodId") final String paymentMethodId, @HeaderParam(HDR_CREATED_BY) final String createdBy, @HeaderParam(HDR_REASON) final String reason, @HeaderParam(HDR_COMMENT) final String comment) { >>>>>>> @PathParam("paymentMethodId") final String paymentMethodId, @HeaderParam(HDR_CREATED_BY) final String createdBy, @HeaderParam(HDR_REASON) final String reason, @HeaderParam(HDR_COMMENT) final String comment) { <<<<<<< /**************************** TAGS AND CUSTOM FIELDS ******************************/ ======= /* * ************************* CUSTOM FIELDS ***************************** */ >>>>>>> /* * ************************* CUSTOM FIELDS ***************************** */
<<<<<<< import org.killbill.billing.invoice.api.InvoiceStatus; ======= import org.killbill.billing.invoice.api.InvoicePaymentType; >>>>>>> import org.killbill.billing.invoice.api.InvoicePaymentType; import org.killbill.billing.invoice.api.InvoiceStatus; <<<<<<< final Invoice invoice = rebalanceAndGetInvoice(invoiceId, internalContext); if (!InvoiceStatus.COMMITTED.equals(invoice.getStatus())) { // abort payment if the invoice status is not COMMITTED return new DefaultPriorPaymentControlResult(true); } // get immutable account and check if it is child and payment is delegated to parent => abort final ImmutableAccountData accountData = accountApi.getImmutableAccountDataById(invoice.getAccountId(), internalContext); if ((accountData != null) && (accountData.getParentAccountId() != null) && accountData.isPaymentDelegatedToParent()) { return new DefaultPriorPaymentControlResult(true); } ======= final Invoice invoice = getAndSanitizeInvoice(invoiceId, internalContext); >>>>>>> final Invoice invoice = getAndSanitizeInvoice(invoiceId, internalContext); if (!InvoiceStatus.COMMITTED.equals(invoice.getStatus())) { // abort payment if the invoice status is not COMMITTED return new DefaultPriorPaymentControlResult(true); } // get immutable account and check if it is child and payment is delegated to parent => abort final ImmutableAccountData accountData = accountApi.getImmutableAccountDataById(invoice.getAccountId(), internalContext); if ((accountData != null) && (accountData.getParentAccountId() != null) && accountData.isPaymentDelegatedToParent()) { return new DefaultPriorPaymentControlResult(true); }
<<<<<<< DefaultEntitlementBillingApi api = new DefaultEntitlementBillingApi(factory, dao, accountApi, bcdCalculator); SortedSet<BillingEvent> events = api.getBillingEventsForAccountAndUpdateAccountBCD(new UUID(0L,0L)); ======= DefaultEntitlementBillingApi api = new DefaultEntitlementBillingApi(factory, null, dao, accountApi, catalogService); SortedSet<BillingEvent> events = api.getBillingEventsForAccount(new UUID(0L,0L)); >>>>>>> DefaultEntitlementBillingApi api = new DefaultEntitlementBillingApi(factory, null, dao, accountApi, bcdCalculator); SortedSet<BillingEvent> events = api.getBillingEventsForAccountAndUpdateAccountBCD(new UUID(0L,0L)); <<<<<<< EntitlementUserApi entitlementApi = BrainDeadProxyFactory.createBrainDeadProxyFor(EntitlementUserApi.class); BillCycleDayCalculator bcdCalculator = new BillCycleDayCalculator(catalogService, entitlementApi); CallContextFactory factory = new DefaultCallContextFactory(clock); DefaultEntitlementBillingApi api = new DefaultEntitlementBillingApi(factory, dao, accountApi, bcdCalculator); SortedSet<BillingEvent> events = api.getBillingEventsForAccountAndUpdateAccountBCD(new UUID(0L,0L)); ======= DefaultEntitlementBillingApi api = new DefaultEntitlementBillingApi(factory, null, dao, accountApi, catalogService); SortedSet<BillingEvent> events = api.getBillingEventsForAccount(new UUID(0L,0L)); >>>>>>> EntitlementUserApi entitlementApi = BrainDeadProxyFactory.createBrainDeadProxyFor(EntitlementUserApi.class); BillCycleDayCalculator bcdCalculator = new BillCycleDayCalculator(catalogService, entitlementApi); CallContextFactory factory = new DefaultCallContextFactory(clock); DefaultEntitlementBillingApi api = new DefaultEntitlementBillingApi(factory, null, dao, accountApi, bcdCalculator); SortedSet<BillingEvent> events = api.getBillingEventsForAccountAndUpdateAccountBCD(new UUID(0L,0L)); <<<<<<< DefaultEntitlementBillingApi api = new DefaultEntitlementBillingApi(factory, dao, accountApi, bcdCalculator); SortedSet<BillingEvent> events = api.getBillingEventsForAccountAndUpdateAccountBCD(new UUID(0L,0L)); ======= DefaultEntitlementBillingApi api = new DefaultEntitlementBillingApi(factory, null, dao, accountApi, catalogService); SortedSet<BillingEvent> events = api.getBillingEventsForAccount(new UUID(0L,0L)); >>>>>>> DefaultEntitlementBillingApi api = new DefaultEntitlementBillingApi(factory, null, dao, accountApi, bcdCalculator); SortedSet<BillingEvent> events = api.getBillingEventsForAccountAndUpdateAccountBCD(new UUID(0L,0L)); <<<<<<< EntitlementUserApi entitlementApi = BrainDeadProxyFactory.createBrainDeadProxyFor(EntitlementUserApi.class); BillCycleDayCalculator bcdCalculator = new BillCycleDayCalculator(catalogService, entitlementApi); CallContextFactory factory = new DefaultCallContextFactory(clock); DefaultEntitlementBillingApi api = new DefaultEntitlementBillingApi(factory, dao, accountApi, bcdCalculator); SortedSet<BillingEvent> events = api.getBillingEventsForAccountAndUpdateAccountBCD(new UUID(0L,0L)); ======= DefaultEntitlementBillingApi api = new DefaultEntitlementBillingApi(factory, null, dao,accountApi,catalogService); SortedSet<BillingEvent> events = api.getBillingEventsForAccount(new UUID(0L,0L)); >>>>>>> EntitlementUserApi entitlementApi = BrainDeadProxyFactory.createBrainDeadProxyFor(EntitlementUserApi.class); BillCycleDayCalculator bcdCalculator = new BillCycleDayCalculator(catalogService, entitlementApi); CallContextFactory factory = new DefaultCallContextFactory(clock); DefaultEntitlementBillingApi api = new DefaultEntitlementBillingApi(factory, null, dao, accountApi, bcdCalculator); SortedSet<BillingEvent> events = api.getBillingEventsForAccountAndUpdateAccountBCD(new UUID(0L,0L)); <<<<<<< DefaultEntitlementBillingApi api = new DefaultEntitlementBillingApi(factory, dao, accountApi, bcdCalculator); SortedSet<BillingEvent> events = api.getBillingEventsForAccountAndUpdateAccountBCD(new UUID(0L,0L)); checkFirstEvent(events, nextPlan, subscription.getStartDate().plusDays(30).getDayOfMonth(), oneId, now, nextPhase, ApiEventType.CREATE.toString()); ======= DefaultEntitlementBillingApi api = new DefaultEntitlementBillingApi(factory, null, dao, accountApi, catalogService); SortedSet<BillingEvent> events = api.getBillingEventsForAccount(new UUID(0L,0L)); checkFirstEvent(events, nextPlan, bundles.get(0).getStartDate().getDayOfMonth(), oneId, now, nextPhase, ApiEventType.CREATE.toString()); >>>>>>> DefaultEntitlementBillingApi api = new DefaultEntitlementBillingApi(factory, null, dao, accountApi, bcdCalculator); SortedSet<BillingEvent> events = api.getBillingEventsForAccountAndUpdateAccountBCD(new UUID(0L,0L)); checkFirstEvent(events, nextPlan, subscription.getStartDate().plusDays(30).getDayOfMonth(), oneId, now, nextPhase, ApiEventType.CREATE.toString());
<<<<<<< import org.killbill.billing.entitlement.api.BlockingStateType; ======= import org.killbill.billing.catalog.api.CatalogApiException; >>>>>>> import org.killbill.billing.catalog.api.CatalogApiException; import org.killbill.billing.entitlement.api.BlockingStateType;
<<<<<<< final int currentAccountBCD = accountApi.getBCD(account.getId(), context); ======= final Map<UUID, Integer> bcdCache =new HashMap<UUID, Integer>(); int currentAccountBCD = accountApi.getBCD(account.getId(), context); >>>>>>> final Map<UUID, Integer> bcdCache = new HashMap<UUID, Integer>(); int currentAccountBCD = accountApi.getBCD(account.getId(), context); <<<<<<< // // A BCD_CHANGE transition defines a new billCycleDayLocal for the subscription and this overrides whatever computation // occurs below (which is based on billing alignment policy). Also multiple of those BCD_CHANGE transitions could occur, // to define different intervals with different billing cycle days. // overridenBCD = transition.getNextBillCycleDayLocal() != null ? transition.getNextBillCycleDayLocal() : overridenBCD; final int bcdLocal = overridenBCD != null ? overridenBCD : calculateBcdForTransition(catalog, baseSubscription, subscription, account, currentAccountBCD, transition); ======= final int bcdLocal = bcdCalculator.calculateBcd(account, currentAccountBCD, bundleId, subscription, transition, bcdCache, context); >>>>>>> // // A BCD_CHANGE transition defines a new billCycleDayLocal for the subscription and this overrides whatever computation // occurs below (which is based on billing alignment policy). Also multiple of those BCD_CHANGE transitions could occur, // to define different intervals with different billing cycle days. // overridenBCD = transition.getNextBillCycleDayLocal() != null ? transition.getNextBillCycleDayLocal() : overridenBCD; final int bcdLocal = overridenBCD != null ? overridenBCD : calculateBcdForTransition(catalog, bcdCache, baseSubscription, subscription, account, currentAccountBCD, transition);
<<<<<<< import com.ning.billing.payment.api.PaymentAttempt.PaymentAttemptStatus; import com.ning.billing.payment.setup.PaymentTestModuleWithMocks; ======= >>>>>>> <<<<<<< PaymentAttempt paymentAttempt = new PaymentAttempt(UUID.randomUUID(), invoice, PaymentAttemptStatus.COMPLETED_SUCCESS); ======= PaymentAttempt paymentAttempt = new DefaultPaymentAttempt(UUID.randomUUID(), invoice); >>>>>>> PaymentAttempt paymentAttempt = new DefaultPaymentAttempt(UUID.randomUUID(), invoice, PaymentAttemptStatus.COMPLETED_SUCCESS); <<<<<<< PaymentAttempt paymentAttempt = new PaymentAttempt(UUID.randomUUID(), invoice, PaymentAttemptStatus.COMPLETED_SUCCESS); ======= PaymentAttempt paymentAttempt = new DefaultPaymentAttempt(UUID.randomUUID(), invoice); >>>>>>> PaymentAttempt paymentAttempt = new DefaultPaymentAttempt(UUID.randomUUID(), invoice, PaymentAttemptStatus.COMPLETED_SUCCESS);
<<<<<<< import java.util.UUID; ======= import com.ning.billing.util.entity.Entity; >>>>>>> import java.util.UUID; import com.ning.billing.util.entity.Entity; <<<<<<< public interface PaymentInfoEvent extends BusEvent { public UUID getInvoiceId(); public UUID getAccountId(); public String getPaymentId(); ======= public interface PaymentInfoEvent extends Entity, BusEvent { >>>>>>> public interface PaymentInfoEvent extends Entity, BusEvent { public UUID getAccountId(); public UUID getPaymentId(); <<<<<<< public DateTime getUpdatedDate(); ======= >>>>>>> public DateTime getCreatedDate(); public DateTime getUpdatedDate();
<<<<<<< final List<Map<String, Object>> queryResult = handle.select("select * from _invoice_payment_control_plugin_auto_pay_off where account_id = ? and is_active = '1'", accountId.toString()); ======= final List<Map<String, Object>> queryResult = handle.select("select * from invoice_payment_control_plugin_auto_pay_off where account_id = ? and is_active", accountId.toString()); >>>>>>> final List<Map<String, Object>> queryResult = handle.select("select * from invoice_payment_control_plugin_auto_pay_off where account_id = ? and is_active = '1'", accountId.toString()); <<<<<<< handle.execute("update _invoice_payment_control_plugin_auto_pay_off set is_active = '0' where account_id = ?", accountId.toString()); ======= handle.execute("update invoice_payment_control_plugin_auto_pay_off set is_active = false where account_id = ?", accountId.toString()); >>>>>>> handle.execute("update invoice_payment_control_plugin_auto_pay_off set is_active = '0' where account_id = ?", accountId.toString());
<<<<<<< import com.ning.billing.util.callcontext.CallContext; ======= import org.joda.time.DateTimeZone; import com.ning.billing.catalog.api.Currency; >>>>>>> import com.ning.billing.util.callcontext.CallContext; <<<<<<< public void updateAccount(String key, AccountData accountData, CallContext context) throws AccountApiException; ======= public void updateAccount(String key, AccountData accountData) throws AccountApiException; public void updateAccount(UUID accountId, AccountData accountData) throws AccountApiException; >>>>>>> public void updateAccount(String key, AccountData accountData, CallContext context) throws AccountApiException; public void updateAccount(UUID accountId, AccountData accountData, CallContext context) throws AccountApiException;
<<<<<<< recurringInvoiceItem.getSubscriptionId(), recurringInvoiceItem.getBundleId(), ======= account.getId(), recurringInvoiceItem.getSubscriptionId(), >>>>>>> account.getId(), recurringInvoiceItem.getBundleId(), recurringInvoiceItem.getSubscriptionId(), <<<<<<< final InvoiceItem item = new RecurringInvoiceItem(null, subscriptionId, bundleId, "test plan", "test phase", now, now.plusMonths(1), amount, new BigDecimal("1.0"), Currency.USD, now); ======= final InvoiceItem item = new RecurringInvoiceItem(null, account.getId(), subscriptionId, "test plan", "test phase", now, now.plusMonths(1), amount, new BigDecimal("1.0"), Currency.USD); >>>>>>> final InvoiceItem item = new RecurringInvoiceItem(null, account.getId(), bundleId, subscriptionId, "test plan", "test phase", now, now.plusMonths(1), amount, new BigDecimal("1.0"), Currency.USD);
<<<<<<< import com.ning.billing.entitlement.engine.dao.SubscriptionSqlDao; import com.ning.billing.util.ChangeType; ======= >>>>>>> <<<<<<< ======= >>>>>>> <<<<<<< @Override public void setChargedThroughDateFromTransaction(final Transmogrifier transactionalDao, final UUID subscriptionId, final DateTime ctd, final CallContext context) { SubscriptionSqlDao subscriptionSqlDao = transactionalDao.become(SubscriptionSqlDao.class); SubscriptionData subscription = (SubscriptionData) subscriptionSqlDao.getSubscriptionFromId(subscriptionId.toString()); if (subscription == null) { log.warn("Subscription not found when setting CTD."); } else { DateTime chargedThroughDate = subscription.getChargedThroughDate(); if (chargedThroughDate == null || chargedThroughDate.isBefore(ctd)) { subscriptionSqlDao.updateChargedThroughDate(subscriptionId.toString(), ctd.toDate(), context); Long recordId = subscriptionSqlDao.getRecordId(TableName.SUBSCRIPTIONS, subscriptionId.toString()); EntityAudit audit = new EntityAudit(recordId, ChangeType.UPDATE); subscriptionSqlDao.insertAuditFromTransaction(TableName.SUBSCRIPTIONS, audit, context); } } } ======= >>>>>>>
<<<<<<< import org.skife.jdbi.v2.DBI; import org.skife.jdbi.v2.IDBI; ======= import org.skife.jdbi.v2.IDBI; >>>>>>> import org.skife.jdbi.v2.IDBI; <<<<<<< import com.ning.billing.util.glue.ClockModule; import com.ning.billing.util.glue.EventBusModule; import com.ning.billing.util.glue.NotificationQueueModule; ======= import com.ning.billing.util.clock.Clock; import com.ning.billing.util.clock.DefaultClock; import com.ning.billing.util.glue.BusModule; import com.ning.billing.util.glue.NotificationQueueModule; >>>>>>> import com.ning.billing.util.glue.BusModule; import com.ning.billing.util.glue.ClockModule; import com.ning.billing.util.glue.NotificationQueueModule; <<<<<<< install(new NotificationQueueModule()); ======= install(new NotificationQueueModule()); bind(Clock.class).to(DefaultClock.class).asEagerSingleton(); >>>>>>> install(new NotificationQueueModule());
<<<<<<< import java.util.Iterator; import java.util.List; import java.util.UUID; ======= >>>>>>> import java.util.Iterator; import java.util.List; import java.util.UUID; <<<<<<< private final AddonUtils addonUtils; private final EventBus eventBus; ======= private final Bus eventBus; >>>>>>> private final AddonUtils addonUtils; private final Bus eventBus; <<<<<<< DefaultEntitlementBillingApi billingApi, DefaultEntitlementTestApi testApi, DefaultEntitlementMigrationApi migrationApi, AddonUtils addonUtils, EventBus eventBus, ======= DefaultEntitlementBillingApi billingApi, DefaultEntitlementMigrationApi migrationApi, Bus eventBus, >>>>>>> DefaultEntitlementBillingApi billingApi, DefaultEntitlementMigrationApi migrationApi, AddonUtils addonUtils, Bus eventBus, <<<<<<< private void waitForNotificationStartCompletion() { waitForNotificationEventCompletion(true); } private void waitForNotificationStopCompletion() { waitForNotificationEventCompletion(false); } private void waitForNotificationEventCompletion(boolean startEvent) { long ini = System.nanoTime(); synchronized(this) { do { if ((startEvent ? startedNotificationThread : stoppedNotificationThread)) { break; } try { this.wait(NOTIFICATION_THREAD_WAIT_INCREMENT_MS); } catch (InterruptedException e ) { Thread.currentThread().interrupt(); throw new EntitlementError(e); } } while (!(startEvent ? startedNotificationThread : stoppedNotificationThread) && (System.nanoTime() - ini) / NANO_TO_MS < MAX_NOTIFICATION_THREAD_WAIT_MS); if (!(startEvent ? startedNotificationThread : stoppedNotificationThread)) { log.error("Could not {} notification thread in {} msec !!!", (startEvent ? "start" : "stop"), MAX_NOTIFICATION_THREAD_WAIT_MS); throw new EntitlementError("Failed to start service!!"); } log.info("Notification thread has been {} in {} ms", (startEvent ? "started" : "stopped"), (System.nanoTime() - ini) / NANO_TO_MS); } } private void onPhaseEvent(SubscriptionData subscription) { ======= private void insertNextPhaseEvent(SubscriptionData subscription) { >>>>>>> private void onPhaseEvent(SubscriptionData subscription) {
<<<<<<< public List<Notification> getReadyNotifications(@Bind("now") Date now, @Bind("max") int max, @Bind("queueName") String queueName); ======= public List<Notification> getReadyNotifications(@Bind("now") Date now, @Bind("owner") String owner, @Bind("max") int max, @Bind("queue_name") String queueName); >>>>>>> public List<Notification> getReadyNotifications(@Bind("now") Date now, @Bind("owner") String owner, @Bind("max") int max, @Bind("queueName") String queueName); <<<<<<< public void insertClaimedHistory(@Bind("sequenceId") int sequenceId, @Bind("owner") String owner, @Bind("claimedDate") Date claimedDate, @Bind("notificationId") String notificationId); ======= public void insertClaimedHistory(@Bind("owner") String owner, @Bind("claimed_dt") Date clainedDate, @Bind("notification_id") String notificationId); >>>>>>> public void insertClaimedHistory(@Bind("ownerId") String ownerId, @Bind("claimedDate") Date claimedDate, @Bind("notificationId") String notificationId); <<<<<<< stmt.bind("id", evt.getUUID().toString()); stmt.bind("createdDate", getDate(new DateTime())); stmt.bind("notificationKey", evt.getNotificationKey()); stmt.bind("effectiveDate", getDate(evt.getEffectiveDate())); stmt.bind("queueName", evt.getQueueName()); stmt.bind("processingAvailableDate", getDate(evt.getNextAvailableDate())); stmt.bind("processingOwner", evt.getOwner()); stmt.bind("processingState", NotificationLifecycleState.AVAILABLE.toString()); ======= stmt.bind("notification_id", evt.getUUID().toString()); stmt.bind("created_dt", getDate(new DateTime())); stmt.bind("creating_owner", evt.getCreatedOwner()); stmt.bind("notification_key", evt.getNotificationKey()); stmt.bind("effective_dt", getDate(evt.getEffectiveDate())); stmt.bind("queue_name", evt.getQueueName()); stmt.bind("processing_available_dt", getDate(evt.getNextAvailableDate())); stmt.bind("processing_owner", evt.getOwner()); stmt.bind("processing_state", NotificationLifecycleState.AVAILABLE.toString()); >>>>>>> stmt.bind("id", evt.getId().toString()); stmt.bind("createdDate", getDate(new DateTime())); stmt.bind("creatingOwner", evt.getCreatedOwner()); stmt.bind("notificationKey", evt.getNotificationKey()); stmt.bind("effectiveDate", getDate(evt.getEffectiveDate())); stmt.bind("queueName", evt.getQueueName()); stmt.bind("processingAvailableDate", getDate(evt.getNextAvailableDate())); stmt.bind("processingOwner", evt.getOwner()); stmt.bind("processingState", NotificationLifecycleState.AVAILABLE.toString()); <<<<<<< final Long recordId = r.getLong("record_id"); final UUID id = getUUID(r, "id"); ======= final long id = r.getLong("id"); final UUID uuid = UUID.fromString(r.getString("notification_id")); final String createdOwner = r.getString("creating_owner"); >>>>>>> final Long ordering = r.getLong("record_id"); final UUID id = getUUID(r, "id"); final String createdOwner = r.getString("creating_owner"); <<<<<<< return new DefaultNotification(recordId, id, processingOwner, queueName, nextAvailableDate, ======= return new DefaultNotification(id, uuid, createdOwner, processingOwner, queueName, nextAvailableDate, >>>>>>> return new DefaultNotification(ordering, id, createdOwner, processingOwner, queueName, nextAvailableDate,
<<<<<<< import org.killbill.billing.invoice.api.InvoiceStatus; ======= import org.killbill.billing.invoice.api.InvoicePaymentType; >>>>>>> import org.killbill.billing.invoice.api.InvoicePaymentType; import org.killbill.billing.invoice.api.InvoiceStatus; <<<<<<< final Invoice invoice = rebalanceAndGetInvoice(invoiceId, internalContext); if (!InvoiceStatus.COMMITTED.equals(invoice.getStatus())) { // abort payment if the invoice status is not COMMITTED return new DefaultPriorPaymentControlResult(true); } // get immutable account and check if it is child and payment is delegated to parent => abort final ImmutableAccountData accountData = accountApi.getImmutableAccountDataById(invoice.getAccountId(), internalContext); if ((accountData != null) && (accountData.getParentAccountId() != null) && accountData.isPaymentDelegatedToParent()) { return new DefaultPriorPaymentControlResult(true); } ======= final Invoice invoice = getAndSanitizeInvoice(invoiceId, internalContext); >>>>>>> final Invoice invoice = getAndSanitizeInvoice(invoiceId, internalContext); if (!InvoiceStatus.COMMITTED.equals(invoice.getStatus())) { // abort payment if the invoice status is not COMMITTED return new DefaultPriorPaymentControlResult(true); } // get immutable account and check if it is child and payment is delegated to parent => abort final ImmutableAccountData accountData = accountApi.getImmutableAccountDataById(invoice.getAccountId(), internalContext); if ((accountData != null) && (accountData.getParentAccountId() != null) && accountData.isPaymentDelegatedToParent()) { return new DefaultPriorPaymentControlResult(true); }
<<<<<<< expectedExceptions = KillBillClientException.class, expectedExceptionsMessageRegExp = "Missing Base Subscription for bundle 12345") public void testcreateSubscriptionsWithoutBase() throws Exception { ======= expectedExceptions = KillBillClientException.class, expectedExceptionsMessageRegExp = "SubscriptionJson productName needs to be set when no planName is specified") public void testCreateEntitlementsWithoutBase() throws Exception { >>>>>>> expectedExceptions = KillBillClientException.class, expectedExceptionsMessageRegExp = "SubscriptionJson productName needs to be set when no planName is specified") public void testcreateSubscriptionsWithoutBase() throws Exception { <<<<<<< @Test(groups = "slow", description = "Create addOns in a bundle where BP subscription already exist") ======= @Test(groups = "slow", description = "Create addOns in a bundle where BP subscription already exists") >>>>>>> @Test(groups = "slow", description = "Create addOns in a bundle where BP subscription already exist")
<<<<<<< import com.ning.billing.payment.glue.PaymentModule; ======= import com.ning.billing.payment.setup.PaymentModule; import com.ning.billing.util.email.EmailModule; import com.ning.billing.util.email.templates.TemplateModule; >>>>>>> import com.ning.billing.payment.glue.PaymentModule; import com.ning.billing.util.email.EmailModule; import com.ning.billing.util.email.templates.TemplateModule;
<<<<<<< public DefaultPaymentInfoEvent(@JsonProperty("accountId") UUID accountId, @JsonProperty("invoiceId") UUID invoiceId, @JsonProperty("paymentId") String paymentId, @JsonProperty("amount") BigDecimal amount, @JsonProperty("refundAmount") BigDecimal refundAmount, @JsonProperty("bankIdentificationNumber") String bankIdentificationNumber, @JsonProperty("paymentNumber") String paymentNumber, @JsonProperty("status") String status, @JsonProperty("type") String type, @JsonProperty("referenceId") String referenceId, @JsonProperty("paymentMethodId") String paymentMethodId, @JsonProperty("paymentMethod") String paymentMethod, @JsonProperty("cardType") String cardType, @JsonProperty("cardCountry") String cardCountry, @JsonProperty("userToken") UUID userToken, @JsonProperty("effectiveDate") DateTime effectiveDate, @JsonProperty("createdDate") DateTime createdDate, @JsonProperty("updatedDate") DateTime updatedDate) { this.accountId = accountId; this.invoiceId = invoiceId; this.paymentId = paymentId; ======= public DefaultPaymentInfoEvent(@JsonProperty("id") UUID id, @JsonProperty("amount") BigDecimal amount, @JsonProperty("refundAmount") BigDecimal refundAmount, @JsonProperty("bankIdentificationNumber") String bankIdentificationNumber, @JsonProperty("paymentNumber") String paymentNumber, @JsonProperty("status") String status, @JsonProperty("type") String type, @JsonProperty("referenceId") String referenceId, @JsonProperty("paymentMethodId") String paymentMethodId, @JsonProperty("paymentMethod") String paymentMethod, @JsonProperty("cardType") String cardType, @JsonProperty("cardCountry") String cardCountry, @JsonProperty("userToken") UUID userToken, @JsonProperty("effectiveDate") DateTime effectiveDate) { super(id); >>>>>>> public DefaultPaymentInfoEvent(@JsonProperty("id") UUID id, @JsonProperty("accountId") UUID accountId, @JsonProperty("paymentId") UUID paymentId, @JsonProperty("amount") BigDecimal amount, @JsonProperty("refundAmount") BigDecimal refundAmount, @JsonProperty("bankIdentificationNumber") String bankIdentificationNumber, @JsonProperty("paymentNumber") String paymentNumber, @JsonProperty("status") String status, @JsonProperty("type") String type, @JsonProperty("referenceId") String referenceId, @JsonProperty("paymentMethodId") String paymentMethodId, @JsonProperty("paymentMethod") String paymentMethod, @JsonProperty("cardType") String cardType, @JsonProperty("cardCountry") String cardCountry, @JsonProperty("userToken") UUID userToken, @JsonProperty("effectiveDate") DateTime effectiveDate, @JsonProperty("createdDate") DateTime createdDate, @JsonProperty("updatedDate") DateTime updatedDate) { super(id); this.accountId = accountId; this.paymentId = paymentId; <<<<<<< public String getPaymentId() { return paymentId; } @Override public UUID getInvoiceId() { return invoiceId; } @Override public UUID getAccountId() { return accountId; } @Override ======= >>>>>>> public UUID getPaymentId() { return paymentId; } @Override public UUID getId() { return id; } @Override public UUID getAccountId() { return accountId; } @Override <<<<<<< private UUID invoiceId; private UUID accountId; private String paymentId; ======= private UUID id; >>>>>>> private UUID id; private UUID accountId; private UUID paymentId; <<<<<<< this.accountId = src.accountId; this.invoiceId = src.invoiceId; this.paymentId = src.paymentId; ======= this.id = src.id; >>>>>>> this.accountId = src.accountId; this.id = src.id; this.paymentId = src.paymentId;
<<<<<<< private final CatalogService catalogService; ======= private final BlockingCalculator blockCalculator; >>>>>>> private final CatalogService catalogService; private final BlockingCalculator blockCalculator; <<<<<<< BillCycleDayCalculator bcdCalculator, EntitlementUserApi entitlementUserApi, final CatalogService catalogService) { ======= BillCycleDayCalculator bcdCalculator, EntitlementUserApi entitlementUserApi, BlockingCalculator blockCalculator) { >>>>>>> final BillCycleDayCalculator bcdCalculator, final EntitlementUserApi entitlementUserApi, final BlockingCalculator blockCalculator, final CatalogService catalogService) { <<<<<<< this.catalogService = catalogService; ======= this.blockCalculator = blockCalculator; >>>>>>> this.catalogService = catalogService; this.blockCalculator = blockCalculator;
<<<<<<< import org.killbill.billing.invoice.api.InvoiceStatus; ======= import org.killbill.billing.invoice.api.InvoiceItemType; >>>>>>> import org.killbill.billing.invoice.api.InvoiceStatus; import org.killbill.billing.invoice.api.InvoiceItemType; <<<<<<< final InvoiceItem createdExternalCharge = killBillClient.createExternalCharge(externalCharge, clock.getUTCNow(), false, true, createdBy, reason, comment); ======= final InvoiceItem createdExternalCharge = killBillClient.createExternalCharge(externalCharge, clock.getUTCToday(), false, createdBy, reason, comment); >>>>>>> final InvoiceItem createdExternalCharge = killBillClient.createExternalCharge(externalCharge, clock.getUTCToday(), false, true, createdBy, reason, comment); <<<<<<< final List<InvoiceItem> createdExternalCharges = killBillClient.createExternalCharges(externalCharges, clock.getUTCNow(), false, true, createdBy, reason, comment); ======= final List<InvoiceItem> createdExternalCharges = killBillClient.createExternalCharges(externalCharges, clock.getUTCToday(), false, createdBy, reason, comment); >>>>>>> final List<InvoiceItem> createdExternalCharges = killBillClient.createExternalCharges(externalCharges, clock.getUTCToday(), false, true, createdBy, reason, comment); <<<<<<< final InvoiceItem createdExternalCharge = killBillClient.createExternalCharge(externalCharge, clock.getUTCNow(), true, true, createdBy, reason, comment); ======= final InvoiceItem createdExternalCharge = killBillClient.createExternalCharge(externalCharge, clock.getUTCToday(), true, createdBy, reason, comment); >>>>>>> final InvoiceItem createdExternalCharge = killBillClient.createExternalCharge(externalCharge, clock.getUTCToday(), true, true, createdBy, reason, comment); <<<<<<< final InvoiceItem createdExternalCharge = killBillClient.createExternalCharge(externalCharge, clock.getUTCNow(), false, true, createdBy, reason, comment); ======= final InvoiceItem createdExternalCharge = killBillClient.createExternalCharge(externalCharge, clock.getUTCToday(), false, createdBy, reason, comment); >>>>>>> final InvoiceItem createdExternalCharge = killBillClient.createExternalCharge(externalCharge, clock.getUTCToday(), false, true, createdBy, reason, comment); <<<<<<< final InvoiceItem createdExternalCharge = killBillClient.createExternalCharge(externalCharge, clock.getUTCNow(), false, true, createdBy, reason, comment); ======= final InvoiceItem createdExternalCharge = killBillClient.createExternalCharge(externalCharge, clock.getUTCToday(), false, createdBy, reason, comment); >>>>>>> final InvoiceItem createdExternalCharge = killBillClient.createExternalCharge(externalCharge, clock.getUTCToday(), false, true, createdBy, reason, comment); <<<<<<< final InvoiceItem createdExternalCharge = killBillClient.createExternalCharge(externalCharge, clock.getUTCNow(), true, true, createdBy, reason, comment); ======= final InvoiceItem createdExternalCharge = killBillClient.createExternalCharge(externalCharge, clock.getUTCToday(), true, createdBy, reason, comment); >>>>>>> final InvoiceItem createdExternalCharge = killBillClient.createExternalCharge(externalCharge, clock.getUTCToday(), true, true, createdBy, reason, comment); <<<<<<< final InvoiceItem createdExternalCharge = killBillClient.createExternalCharge(externalCharge, clock.getUTCNow(), false, true, createdBy, reason, comment); ======= final InvoiceItem createdExternalCharge = killBillClient.createExternalCharge(externalCharge, clock.getUTCToday(), false, createdBy, reason, comment); >>>>>>> final InvoiceItem createdExternalCharge = killBillClient.createExternalCharge(externalCharge, clock.getUTCToday(), false, true, createdBy, reason, comment); <<<<<<< @Test(groups = "slow", description = "Can add a credit to a new invoice") public void testCreateCreditInvoiceAndMoveStatus() throws Exception { final Account account = createAccountWithDefaultPaymentMethod(); final DateTime effectiveDate = clock.getUTCNow(); final BigDecimal creditAmount = BigDecimal.TEN; final Credit credit = new Credit(); credit.setAccountId(account.getAccountId()); credit.setInvoiceId(null); credit.setCreditAmount(creditAmount); final Credit creditJson = killBillClient.createCredit(credit, false, createdBy, reason, comment); Invoice invoice = killBillClient.getInvoice(creditJson.getInvoiceId()); Assert.assertEquals(invoice.getStatus(), InvoiceStatus.DRAFT.toString()); killBillClient.commitInvoice(invoice.getInvoiceId(), createdBy, reason, comment); invoice = killBillClient.getInvoice(creditJson.getInvoiceId()); Assert.assertEquals(invoice.getStatus(), InvoiceStatus.COMMITTED.toString()); } ======= @Test(groups = "slow", description = "Can create a migration invoice") public void testInvoiceMigration() throws Exception { final Account accountJson = createAccountNoPMBundleAndSubscriptionAndWaitForFirstInvoice(); // Get the invoices final List<Invoice> invoices = killBillClient.getInvoicesForAccount(accountJson.getAccountId(), true, true); assertEquals(invoices.size(), 2); // Migrate an invoice with one external charge final BigDecimal chargeAmount = BigDecimal.TEN; final InvoiceItem externalCharge = new InvoiceItem(); externalCharge.setStartDate(new LocalDate()); externalCharge.setAccountId(accountJson.getAccountId()); externalCharge.setAmount(chargeAmount); externalCharge.setItemType(InvoiceItemType.EXTERNAL_CHARGE.toString()); externalCharge.setCurrency(Currency.valueOf(accountJson.getCurrency())); final Account accountWithBalance = killBillClient.getAccount(accountJson.getAccountId(), true, true); final Invoice migrationInvoice = killBillClient.createMigrationInvoice(accountJson.getAccountId(), null, ImmutableList.<InvoiceItem>of(externalCharge), createdBy, reason, comment); assertEquals(migrationInvoice.getBalance(), BigDecimal.ZERO); assertEquals(migrationInvoice.getItems().size(), 1); assertEquals(migrationInvoice.getItems().get(0).getAmount().compareTo(chargeAmount), 0); assertEquals(migrationInvoice.getItems().get(0).getCurrency(), Currency.valueOf(accountJson.getCurrency())); final List<Invoice> invoicesWithMigration = killBillClient.getInvoicesForAccount(accountJson.getAccountId(), true, true); assertEquals(invoicesWithMigration.size(), 3); final Account accountWithBalanceAfterMigration = killBillClient.getAccount(accountJson.getAccountId(), true, true); assertEquals(accountWithBalanceAfterMigration.getAccountBalance().compareTo(accountWithBalance.getAccountBalance()), 0); } >>>>>>> @Test(groups = "slow", description = "Can add a credit to a new invoice") public void testCreateCreditInvoiceAndMoveStatus() throws Exception { final Account account = createAccountWithDefaultPaymentMethod(); final DateTime effectiveDate = clock.getUTCNow(); final BigDecimal creditAmount = BigDecimal.TEN; final Credit credit = new Credit(); credit.setAccountId(account.getAccountId()); credit.setInvoiceId(null); credit.setCreditAmount(creditAmount); final Credit creditJson = killBillClient.createCredit(credit, false, createdBy, reason, comment); Invoice invoice = killBillClient.getInvoice(creditJson.getInvoiceId()); Assert.assertEquals(invoice.getStatus(), InvoiceStatus.DRAFT.toString()); killBillClient.commitInvoice(invoice.getInvoiceId(), createdBy, reason, comment); invoice = killBillClient.getInvoice(creditJson.getInvoiceId()); Assert.assertEquals(invoice.getStatus(), InvoiceStatus.COMMITTED.toString()); } @Test(groups = "slow", description = "Can create a migration invoice") public void testInvoiceMigration() throws Exception { final Account accountJson = createAccountNoPMBundleAndSubscriptionAndWaitForFirstInvoice(); // Get the invoices final List<Invoice> invoices = killBillClient.getInvoicesForAccount(accountJson.getAccountId(), true, true); assertEquals(invoices.size(), 2); // Migrate an invoice with one external charge final BigDecimal chargeAmount = BigDecimal.TEN; final InvoiceItem externalCharge = new InvoiceItem(); externalCharge.setStartDate(new LocalDate()); externalCharge.setAccountId(accountJson.getAccountId()); externalCharge.setAmount(chargeAmount); externalCharge.setItemType(InvoiceItemType.EXTERNAL_CHARGE.toString()); externalCharge.setCurrency(Currency.valueOf(accountJson.getCurrency())); final Account accountWithBalance = killBillClient.getAccount(accountJson.getAccountId(), true, true); final Invoice migrationInvoice = killBillClient.createMigrationInvoice(accountJson.getAccountId(), null, ImmutableList.<InvoiceItem>of(externalCharge), createdBy, reason, comment); assertEquals(migrationInvoice.getBalance(), BigDecimal.ZERO); assertEquals(migrationInvoice.getItems().size(), 1); assertEquals(migrationInvoice.getItems().get(0).getAmount().compareTo(chargeAmount), 0); assertEquals(migrationInvoice.getItems().get(0).getCurrency(), Currency.valueOf(accountJson.getCurrency())); final List<Invoice> invoicesWithMigration = killBillClient.getInvoicesForAccount(accountJson.getAccountId(), true, true); assertEquals(invoicesWithMigration.size(), 3); final Account accountWithBalanceAfterMigration = killBillClient.getAccount(accountJson.getAccountId(), true, true); assertEquals(accountWithBalanceAfterMigration.getAccountBalance().compareTo(accountWithBalance.getAccountBalance()), 0); }
<<<<<<< private DateTimeZone timeZone; private String locale; private String address1; private String address2; private String companyName; private String city; private String stateOrProvince; private String country; private String postalCode; private String phone; ======= private BigDecimal balance; private DateTime createdDate; private DateTime updatedDate; >>>>>>> private DateTimeZone timeZone; private String locale; private String address1; private String address2; private String companyName; private String city; private String stateOrProvince; private String country; private String postalCode; private String phone; private DateTime createdDate; private DateTime updatedDate; <<<<<<< currency, billingCycleDay, paymentProviderName, timeZone, locale, address1, address2, companyName, city, stateOrProvince, country, postalCode, phone); ======= phone, currency, billingCycleDay, paymentProviderName, balance, createdDate, updatedDate); >>>>>>> currency, billingCycleDay, paymentProviderName, timeZone, locale, address1, address2, companyName, city, stateOrProvince, country, postalCode, phone, createdDate, updatedDate);
<<<<<<< import org.killbill.billing.payment.config.MultiTenantPaymentConfig; ======= import org.killbill.billing.payment.caching.EhCacheStateMachineConfigCache; import org.killbill.billing.payment.caching.StateMachineConfigCache; import org.killbill.billing.payment.caching.StateMachineConfigCacheInvalidationCallback; >>>>>>> import org.killbill.billing.payment.config.MultiTenantPaymentConfig; import org.killbill.billing.payment.caching.EhCacheStateMachineConfigCache; import org.killbill.billing.payment.caching.StateMachineConfigCache; import org.killbill.billing.payment.caching.StateMachineConfigCacheInvalidationCallback; <<<<<<< import org.killbill.billing.util.config.definition.PaymentConfig; ======= import org.killbill.billing.tenant.api.TenantInternalApi.CacheInvalidationCallback; import org.killbill.billing.util.config.PaymentConfig; >>>>>>> import org.killbill.billing.util.config.definition.PaymentConfig; import org.killbill.billing.tenant.api.TenantInternalApi.CacheInvalidationCallback; <<<<<<< public static final String STATIC_CONFIG = "StaticConfig"; ======= >>>>>>> public static final String STATIC_CONFIG = "StaticConfig";
<<<<<<< PaymentAttempt originalPaymentAttempt = new PaymentAttempt(paymentAttemptId, invoiceId, accountId, invoiceAmount, Currency.USD, clock.getUTCNow(), clock.getUTCNow(), paymentId, 0, PaymentAttemptStatus.IN_PROCESSING); PaymentAttempt attempt = paymentDao.createPaymentAttempt(originalPaymentAttempt, PaymentAttemptStatus.IN_PROCESSING, thisContext); ======= PaymentAttempt originalPaymentAttempt = new DefaultPaymentAttempt(paymentAttemptId, invoiceId, accountId, invoiceAmount, Currency.USD, clock.getUTCNow(), clock.getUTCNow(), paymentId, 0, null, null); PaymentAttempt attempt = paymentDao.createPaymentAttempt(originalPaymentAttempt, thisContext); >>>>>>> PaymentAttempt originalPaymentAttempt = new DefaultPaymentAttempt(paymentAttemptId, invoiceId, accountId, invoiceAmount, Currency.USD, clock.getUTCNow(), clock.getUTCNow(), paymentId, 0, null, null, PaymentAttemptStatus.IN_PROCESSING); PaymentAttempt attempt = paymentDao.createPaymentAttempt(originalPaymentAttempt, PaymentAttemptStatus.IN_PROCESSING, thisContext);
<<<<<<< ======= import com.ning.billing.util.Hostname; import com.ning.billing.util.config.NotificationConfig; >>>>>>> import com.ning.billing.util.Hostname; <<<<<<< final Notification notification = new DefaultNotification("MockQueue", getHostname(), notificationKey.getClass().getName(), json, context.getUserToken(), UUID.randomUUID(), futureNotificationTime, null, 0L); ======= final Notification notification = new DefaultNotification("MockQueue", hostname, notificationKey.getClass().getName(), json, accountId, futureNotificationTime, null, 0L); >>>>>>> final Notification notification = new DefaultNotification("MockQueue", hostname, notificationKey.getClass().getName(), json, context.getUserToken(), UUID.randomUUID(), futureNotificationTime, null, 0L);
<<<<<<< import com.ning.billing.payment.retry.FailedPaymentRetryService; ======= import com.ning.billing.util.bus.Bus; import com.ning.billing.util.bus.BusEvent; import com.ning.billing.util.bus.Bus.EventBusException; >>>>>>> import com.ning.billing.payment.retry.FailedPaymentRetryService; import com.ning.billing.util.bus.Bus; import com.ning.billing.util.bus.BusEvent; import com.ning.billing.util.bus.Bus.EventBusException; <<<<<<< private final GlobalLocker locker; ======= private final Bus eventBus; >>>>>>> private final Bus eventBus; private final GlobalLocker locker; <<<<<<< public DefaultPaymentApi(final PaymentProviderPluginRegistry pluginRegistry, final AccountUserApi accountUserApi, final InvoicePaymentApi invoicePaymentApi, final FailedPaymentRetryService retryService, final PaymentDao paymentDao, final PaymentConfig config, final GlobalLocker locker) { ======= public DefaultPaymentApi(PaymentProviderPluginRegistry pluginRegistry, AccountUserApi accountUserApi, InvoicePaymentApi invoicePaymentApi, RetryService retryService, PaymentDao paymentDao, PaymentConfig config, Bus eventBus) { >>>>>>> public DefaultPaymentApi(final PaymentProviderPluginRegistry pluginRegistry, final AccountUserApi accountUserApi, final InvoicePaymentApi invoicePaymentApi, final FailedPaymentRetryService retryService, final PaymentDao paymentDao, final PaymentConfig config, final Bus eventBus, final GlobalLocker locker) { <<<<<<< this.locker = locker; ======= this.eventBus = eventBus; >>>>>>> this.eventBus = eventBus; this.locker = locker;
<<<<<<< import com.fasterxml.jackson.annotation.JsonAutoDetect; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.base.Function; import com.google.common.collect.Collections2; import com.google.common.collect.Lists; @JsonAutoDetect(fieldVisibility = JsonAutoDetect.Visibility.ANY) ======= import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.base.Function; import com.google.common.collect.ImmutableList; import com.google.common.collect.Lists; >>>>>>> import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.base.Function; import com.google.common.collect.ImmutableList; import com.google.common.collect.Lists; <<<<<<< private final ProductJson[] products; ======= private final List<ProductJson> products; >>>>>>> private final List<ProductJson> products; <<<<<<< private Collection<String> toProductNames(Product[] in) { return Collections2.transform(Lists.newArrayList(in), new Function<Product, String>() { @Override public String apply(Product input) { return input.getName(); } }); ======= private List<String> toProductNames(final Product[] in) { return Lists.transform(ImmutableList.<Product>copyOf(in), new Function<Product, String>() { @Override public String apply(final Product input) { return input.getName(); } }); >>>>>>> private List<String> toProductNames(final Product[] in) { return Lists.transform(ImmutableList.<Product>copyOf(in), new Function<Product, String>() { @Override public String apply(final Product input) { return input.getName(); } }); <<<<<<< public ProductJson[] getProducts() { return products; ======= @Override public boolean equals(final Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } final CatalogJsonSimple that = (CatalogJsonSimple) o; if (name != null ? !name.equals(that.name) : that.name != null) { return false; } if (products != null ? !products.equals(that.products) : that.products != null) { return false; } return true; >>>>>>> @Override public boolean equals(final Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } final CatalogJsonSimple that = (CatalogJsonSimple) o; if (name != null ? !name.equals(that.name) : that.name != null) { return false; } if (products != null ? !products.equals(that.products) : that.products != null) { return false; } return true; <<<<<<< @JsonAutoDetect(fieldVisibility = JsonAutoDetect.Visibility.ANY) ======= >>>>>>> <<<<<<< private final String[] included; private final String[] available; ======= >>>>>>> <<<<<<< public ProductJson(@JsonProperty("type") String type, @JsonProperty("name") String name, @JsonProperty("plans") List<PlanJson> plans, @JsonProperty("included") Collection<String> included, @JsonProperty("available") Collection<String> available) { super(); ======= public ProductJson(@JsonProperty("type") final String type, @JsonProperty("name") final String name, @JsonProperty("plans") final List<PlanJson> plans, @JsonProperty("included") final List<String> included, @JsonProperty("available") final List<String> available) { >>>>>>> public ProductJson(@JsonProperty("type") final String type, @JsonProperty("name") final String name, @JsonProperty("plans") final List<PlanJson> plans, @JsonProperty("included") final List<String> included, @JsonProperty("available") final List<String> available) { <<<<<<< @JsonAutoDetect(fieldVisibility = JsonAutoDetect.Visibility.ANY) ======= >>>>>>> <<<<<<< public PhaseJson[] getPhases() { ======= public List<PhaseJson> getPhases() { >>>>>>> public List<PhaseJson> getPhases() { <<<<<<< @JsonAutoDetect(fieldVisibility = JsonAutoDetect.Visibility.ANY) ======= >>>>>>> <<<<<<< public PhaseJson(@JsonProperty("type") String type, @JsonProperty("prices") Map<String, BigDecimal> prices) { super(); ======= public PhaseJson(@JsonProperty("type") final String type, @JsonProperty("prices") final List<PriceJson> prices) { >>>>>>> public PhaseJson(@JsonProperty("type") final String type, @JsonProperty("prices") final List<PriceJson> prices) { <<<<<<< public Map<String, BigDecimal> getPrices() { ======= public List<PriceJson> getPrices() { >>>>>>> public List<PriceJson> getPrices() {
<<<<<<< private final UUID accountId; private final UUID invoiceId; ======= private final String externalPaymentId; >>>>>>> private final UUID accountId; private final UUID invoiceId; private final String externalPaymentId; <<<<<<< @JsonProperty("accountId") UUID accountId, @JsonProperty("invoiceId") UUID invoiceId, @JsonProperty("amount") BigDecimal amount, @JsonProperty("refundAmount") BigDecimal refundAmount, @JsonProperty("bankIdentificationNumber") String bankIdentificationNumber, @JsonProperty("paymentNumber") String paymentNumber, @JsonProperty("status") String status, @JsonProperty("type") String type, @JsonProperty("referenceId") String referenceId, @JsonProperty("paymentMethodId") String paymentMethodId, @JsonProperty("paymentMethod") String paymentMethod, @JsonProperty("cardType") String cardType, @JsonProperty("cardCountry") String cardCountry, @JsonProperty("userToken") UUID userToken, @JsonProperty("effectiveDate") DateTime effectiveDate, @JsonProperty("createdDate") DateTime createdDate, @JsonProperty("updatedDate") DateTime updatedDate) { ======= @JsonProperty("externalPaymentId") String externalPaymentId, @JsonProperty("amount") BigDecimal amount, @JsonProperty("refundAmount") BigDecimal refundAmount, @JsonProperty("bankIdentificationNumber") String bankIdentificationNumber, @JsonProperty("paymentNumber") String paymentNumber, @JsonProperty("status") String status, @JsonProperty("type") String type, @JsonProperty("referenceId") String referenceId, @JsonProperty("paymentMethodId") String paymentMethodId, @JsonProperty("paymentMethod") String paymentMethod, @JsonProperty("cardType") String cardType, @JsonProperty("cardCountry") String cardCountry, @JsonProperty("userToken") UUID userToken, @JsonProperty("effectiveDate") DateTime effectiveDate) { >>>>>>> @JsonProperty("accountId") UUID accountId, @JsonProperty("invoiceId") UUID invoiceId, @JsonProperty("externalPaymentId") String externalPaymentId, @JsonProperty("amount") BigDecimal amount, @JsonProperty("refundAmount") BigDecimal refundAmount, @JsonProperty("bankIdentificationNumber") String bankIdentificationNumber, @JsonProperty("paymentNumber") String paymentNumber, @JsonProperty("status") String status, @JsonProperty("type") String type, @JsonProperty("referenceId") String referenceId, @JsonProperty("paymentMethodId") String paymentMethodId, @JsonProperty("paymentMethod") String paymentMethod, @JsonProperty("cardType") String cardType, @JsonProperty("cardCountry") String cardCountry, @JsonProperty("userToken") UUID userToken, @JsonProperty("effectiveDate") DateTime effectiveDate, @JsonProperty("createdDate") DateTime createdDate, @JsonProperty("updatedDate") DateTime updatedDate) { <<<<<<< this.accountId = accountId; this.invoiceId = invoiceId; ======= this.externalPaymentId = externalPaymentId; >>>>>>> this.accountId = accountId; this.invoiceId = invoiceId; this.externalPaymentId = externalPaymentId; <<<<<<< src.accountId, src.invoiceId, src.amount, src.refundAmount, src.bankIdentificationNumber, src.paymentNumber, src.status, src.type, src.referenceId, src.paymentMethodId, src.paymentMethod, src.cardType, src.cardCountry, src.userToken, src.effectiveDate, src.createdDate, src.updatedDate); } public DefaultPaymentInfoEvent(PaymentInfoPlugin info, UUID accountId, UUID invoiceId) { this(UUID.randomUUID(), accountId, invoiceId, info.getAmount(), info.getRefundAmount(), info.getBankIdentificationNumber(), info.getPaymentNumber(), info.getStatus(), info.getCardType(), info.getReferenceId(), info.getPaymentMethodId(), info.getPaymentMethod(), info.getCardType(), info.getCardCountry(), null, info.getEffectiveDate(), info.getCreatedDate(), info.getUpdatedDate()); ======= src.externalPaymentId, src.amount, src.refundAmount, src.bankIdentificationNumber, src.paymentNumber, src.status, src.type, src.referenceId, src.paymentMethodId, src.paymentMethod, src.cardType, src.cardCountry, src.userToken, src.effectiveDate); >>>>>>> src.accountId, src.invoiceId, src.externalPaymentId, src.amount, src.refundAmount, src.bankIdentificationNumber, src.paymentNumber, src.status, src.type, src.referenceId, src.paymentMethodId, src.paymentMethod, src.cardType, src.cardCountry, src.userToken, src.effectiveDate, src.createdDate, src.updatedDate); } public DefaultPaymentInfoEvent(PaymentInfoPlugin info, UUID accountId, UUID invoiceId) { this(UUID.randomUUID(), accountId, invoiceId, info.getExternalPaymentId(), info.getAmount(), info.getRefundAmount(), info.getBankIdentificationNumber(), info.getPaymentNumber(), info.getStatus(), info.getCardType(), info.getReferenceId(), info.getPaymentMethodId(), info.getPaymentMethod(), info.getCardType(), info.getCardCountry(), null, info.getEffectiveDate(), info.getCreatedDate(), info.getUpdatedDate()); <<<<<<< public UUID getId() { return id; } @Override public UUID getAccountId() { return accountId; } @Override public UUID getInvoiceId() { return invoiceId; } @Override ======= public String getExternalPaymentId() { return externalPaymentId; } @Override >>>>>>> public UUID getId() { return id; } @Override public UUID getAccountId() { return accountId; } @Override public UUID getInvoiceId() { return invoiceId; } @Override public String getExternalPaymentId() { return externalPaymentId; } @Override <<<<<<< private UUID accountId; private UUID invoiceId; ======= private String externalPaymentId; >>>>>>> private UUID accountId; private UUID invoiceId; private String externalPaymentId; <<<<<<< this.accountId = src.accountId; this.invoiceId = src.invoiceId; ======= this.externalPaymentId = src.externalPaymentId; >>>>>>> this.accountId = src.accountId; this.invoiceId = src.invoiceId; this.externalPaymentId = src.externalPaymentId; <<<<<<< accountId, invoiceId, amount, refundAmount, bankIdentificationNumber, paymentNumber, status, type, referenceId, paymentMethodId, paymentMethod, cardType, cardCountry, userToken, effectiveDate, createdDate, updatedDate); ======= externalPaymentId, amount, refundAmount, bankIdentificationNumber, paymentNumber, status, type, referenceId, paymentMethodId, paymentMethod, cardType, cardCountry, userToken, effectiveDate); >>>>>>> accountId, invoiceId, externalPaymentId, amount, refundAmount, bankIdentificationNumber, paymentNumber, status, type, referenceId, paymentMethodId, paymentMethod, cardType, cardCountry, userToken, effectiveDate, createdDate, updatedDate); <<<<<<< amount, refundAmount, bankIdentificationNumber, paymentNumber, status, type, referenceId, paymentMethodId, paymentMethod, cardType, cardCountry, effectiveDate); ======= externalPaymentId, amount, refundAmount, bankIdentificationNumber, paymentNumber, status, type, referenceId, paymentMethodId, paymentMethod, cardType, cardCountry, effectiveDate); >>>>>>> externalPaymentId, amount, refundAmount, bankIdentificationNumber, paymentNumber, status, type, referenceId, paymentMethodId, paymentMethod, cardType, cardCountry, effectiveDate);
<<<<<<< ======= String nextPriceListName = null; Integer nextBillingCycleDayLocal = null; >>>>>>> Integer nextBillingCycleDayLocal = null;
<<<<<<< ======= import org.killbill.billing.invoice.plugin.api.InvoicePluginApi; import org.killbill.billing.osgi.api.OSGIServiceRegistration; import org.skife.config.ConfigSource; import org.skife.config.ConfigurationObjectFactory; >>>>>>> <<<<<<< public class DefaultInvoiceModule extends KillBillModule implements InvoiceModule { ======= import com.google.inject.AbstractModule; import com.google.inject.TypeLiteral; public class DefaultInvoiceModule extends AbstractModule implements InvoiceModule { >>>>>>> import com.google.inject.TypeLiteral; public class DefaultInvoiceModule extends KillBillModule implements InvoiceModule {
<<<<<<< ======= import org.killbill.billing.client.model.Account; import org.killbill.billing.client.model.AuditLog; import org.killbill.billing.client.model.CustomField; >>>>>>>
<<<<<<< import com.ning.billing.entitlement.api.user.SubscriptionEvent; ======= import com.ning.billing.entitlement.api.user.SubscriptionEventTransition; import com.ning.billing.junction.api.BlockingState; >>>>>>> import com.ning.billing.entitlement.api.user.SubscriptionEvent; import com.ning.billing.junction.api.BlockingState;
<<<<<<< import java.util.Currency; ======= import java.util.ArrayList; >>>>>>> import java.util.Currency; <<<<<<< import org.killbill.billing.client.model.InvoiceItems; ======= import org.killbill.billing.client.model.Account; import org.killbill.billing.client.model.AuditLog; import org.killbill.billing.client.model.Credit; import org.killbill.billing.client.model.Invoice; import org.killbill.billing.client.model.InvoiceDryRun; import org.killbill.billing.client.model.InvoiceItem; import org.killbill.billing.client.model.InvoicePayment; >>>>>>> import org.killbill.billing.client.model.InvoiceItems; <<<<<<< invoiceApi.adjustInvoiceItem(invoiceItem, invoice.getInvoiceId(), null, requestOptions); ======= final String itemDetails = "{\n" + " \"user\": \"admin\",\n" + " \"reason\": \"SLA not met\"\n" + "}"; adjustmentInvoiceItem.setItemDetails(itemDetails); killBillClient.adjustInvoiceItem(adjustmentInvoiceItem, requestOptions); >>>>>>> final String itemDetails = "{\n" + " \"user\": \"admin\",\n" + " \"reason\": \"SLA not met\"\n" + "}"; adjustmentInvoiceItem.setItemDetails(itemDetails); invoiceApi.adjustInvoiceItem(invoiceItem, invoice.getInvoiceId(), null, requestOptions);
<<<<<<< import com.ning.billing.entitlement.api.billing.IBillingEvent; ======= import com.ning.billing.entitlement.api.billing.BillingMode; import com.ning.billing.entitlement.api.billing.BillingEvent; >>>>>>> import com.ning.billing.entitlement.api.billing.BillingEvent; import com.ning.billing.entitlement.api.billing.BillingModeType; <<<<<<< private void processEvent(UUID invoiceId, IBillingEvent event, List<IInvoiceItem> items, DateTime targetDate, Currency targetCurrency) { ======= private void processEvent(UUID invoiceId, BillingEvent event, List<InvoiceItem> items, DateTime targetDate, Currency targetCurrency) { >>>>>>> private void processEvent(UUID invoiceId, BillingEvent event, List<InvoiceItem> items, DateTime targetDate, Currency targetCurrency) { <<<<<<< private void processEvents(UUID invoiceId, IBillingEvent firstEvent, IBillingEvent secondEvent, List<IInvoiceItem> items, DateTime targetDate, Currency targetCurrency) { ======= private void processEvents(UUID invoiceId, BillingEvent firstEvent, BillingEvent secondEvent, List<InvoiceItem> items, DateTime targetDate, Currency targetCurrency) { >>>>>>> private void processEvents(UUID invoiceId, BillingEvent firstEvent, BillingEvent secondEvent, List<InvoiceItem> items, DateTime targetDate, Currency targetCurrency) { <<<<<<< private void addInvoiceItem(UUID invoiceId, List<IInvoiceItem> items, IBillingEvent event, DateTime billThroughDate, BigDecimal amount, BigDecimal rate, Currency currency) { ======= private void addInvoiceItem(UUID invoiceId, List<InvoiceItem> items, BillingEvent event, DateTime billThroughDate, BigDecimal amount, BigDecimal rate, Currency currency) { >>>>>>> private void addInvoiceItem(UUID invoiceId, List<InvoiceItem> items, BillingEvent event, DateTime billThroughDate, BigDecimal amount, BigDecimal rate, Currency currency) { <<<<<<< private BigDecimal calculateInvoiceItemAmount(IBillingEvent event, DateTime targetDate, BigDecimal rate){ BillingMode billingMode = getBillingMode(event.getBillingMode()); ======= private BigDecimal calculateInvoiceItemAmount(BillingEvent event, DateTime targetDate, BigDecimal rate){ IBillingMode billingMode = getBillingMode(event.getBillingMode()); >>>>>>> private BigDecimal calculateInvoiceItemAmount(BillingEvent event, DateTime targetDate, BigDecimal rate){ BillingMode billingMode = getBillingMode(event.getBillingMode()); <<<<<<< private BigDecimal calculateInvoiceItemAmount(IBillingEvent firstEvent, IBillingEvent secondEvent, DateTime targetDate, BigDecimal rate) { BillingMode billingMode = getBillingMode(firstEvent.getBillingMode()); ======= private BigDecimal calculateInvoiceItemAmount(BillingEvent firstEvent, BillingEvent secondEvent, DateTime targetDate, BigDecimal rate) { IBillingMode billingMode = getBillingMode(firstEvent.getBillingMode()); >>>>>>> private BigDecimal calculateInvoiceItemAmount(BillingEvent firstEvent, BillingEvent secondEvent, DateTime targetDate, BigDecimal rate) { BillingMode billingMode = getBillingMode(firstEvent.getBillingMode());
<<<<<<< ======= private long currentVersion; private int billingCycleDayLocal; >>>>>>> private int billingCycleDayLocal; <<<<<<< final DateTime effectiveDate, final UUID subscriptionId, final String planName, final String phaseName, final String priceListName, final boolean active, final DateTime createDate, final DateTime updateDate) { ======= final DateTime requestedDate, final DateTime effectiveDate, final UUID subscriptionId, final String planName, final String phaseName, final String priceListName, final long currentVersion, final int billingCycleDayLocal, final boolean active, final DateTime createDate, final DateTime updateDate) { >>>>>>> final DateTime effectiveDate, final UUID subscriptionId, final String planName, final String phaseName, final String priceListName, final int billingCycleDayLocal, final boolean active, final DateTime createDate, final DateTime updateDate) { <<<<<<< ======= this.currentVersion = currentVersion; this.billingCycleDayLocal = billingCycleDayLocal; >>>>>>> this.billingCycleDayLocal = billingCycleDayLocal; <<<<<<< ======= this.currentVersion = src.getActiveVersion(); this.billingCycleDayLocal = eventType == EventType.BCD_UPDATE ? ((BCDEvent) src).getBillCycleDayLocal() : 0; >>>>>>> this.billingCycleDayLocal = eventType == EventType.BCD_UPDATE ? ((BCDEvent) src).getBillCycleDayLocal() : 0; <<<<<<< ======= public long getCurrentVersion() { return currentVersion; } public int getBillingCycleDayLocal() { return billingCycleDayLocal; } >>>>>>> public int getBillingCycleDayLocal() { return billingCycleDayLocal; } <<<<<<< ======= public void setCurrentVersion(final long currentVersion) { this.currentVersion = currentVersion; } public void setBillingCycleDayLocal(final int billingCycleDayLocal) { this.billingCycleDayLocal = billingCycleDayLocal; } >>>>>>> public void setBillingCycleDayLocal(final int billingCycleDayLocal) { this.billingCycleDayLocal = billingCycleDayLocal; } <<<<<<< final EventBaseBuilder<?> base = ((src.getEventType() == EventType.PHASE) ? new PhaseEventBuilder() : new ApiEventBuilder()) .setTotalOrdering(src.getTotalOrdering()) .setUuid(src.getId()) .setSubscriptionId(src.getSubscriptionId()) .setCreatedDate(src.getCreatedDate()) .setUpdatedDate(src.getUpdatedDate()) .setEffectiveDate(src.getEffectiveDate()) .setActive(src.isActive()); ======= final EventBaseBuilder<?> base; if (src.getEventType() == EventType.PHASE) { base = new PhaseEventBuilder(); } else if (src.getEventType() == EventType.BCD_UPDATE) { base = new BCDEventBuilder(); } else { base = new ApiEventBuilder(); } base.setTotalOrdering(src.getTotalOrdering()) .setUuid(src.getId()) .setSubscriptionId(src.getSubscriptionId()) .setCreatedDate(src.getCreatedDate()) .setUpdatedDate(src.getUpdatedDate()) .setEffectiveDate(src.getEffectiveDate()) .setActiveVersion(src.getCurrentVersion()) .setActive(src.isActive()); >>>>>>> final EventBaseBuilder<?> base; if (src.getEventType() == EventType.PHASE) { base = new PhaseEventBuilder(); } else if (src.getEventType() == EventType.BCD_UPDATE) { base = new BCDEventBuilder(); } else { base = new ApiEventBuilder(); } base.setTotalOrdering(src.getTotalOrdering()) .setUuid(src.getId()) .setSubscriptionId(src.getSubscriptionId()) .setCreatedDate(src.getCreatedDate()) .setUpdatedDate(src.getUpdatedDate()) .setEffectiveDate(src.getEffectiveDate()) .setActive(src.isActive()); <<<<<<< ======= sb.append(", currentVersion=").append(currentVersion); sb.append(", billingCycleDayLocal=").append(billingCycleDayLocal); >>>>>>> sb.append(", billingCycleDayLocal=").append(billingCycleDayLocal);
<<<<<<< import com.ning.billing.account.api.AccountUserApi; import com.ning.billing.invoice.api.InvoiceNotifier; import com.ning.billing.junction.api.BillingApi; ======= import com.ning.billing.account.api.AccountUserApi; import com.ning.billing.account.api.MockAccountUserApi; import com.ning.billing.entitlement.api.SubscriptionApiService; import com.ning.billing.entitlement.api.SubscriptionFactory; import com.ning.billing.invoice.InvoiceDispatcher; import com.ning.billing.invoice.dao.DefaultInvoiceDao; import com.ning.billing.invoice.dao.InvoiceDao; import com.ning.billing.invoice.model.DefaultInvoiceGenerator; import com.ning.billing.invoice.model.InvoiceGenerator; import com.ning.billing.util.callcontext.CallContextFactory; import com.ning.billing.util.callcontext.DefaultCallContextFactory; import com.ning.billing.util.customfield.dao.AuditedCustomFieldDao; import com.ning.billing.util.customfield.dao.CustomFieldDao; import com.ning.billing.util.globallocker.GlobalLocker; import com.ning.billing.util.globallocker.MySqlGlobalLocker; import com.ning.billing.util.tag.dao.AuditedTagDao; import com.ning.billing.util.tag.dao.TagDao; >>>>>>> import com.ning.billing.account.api.AccountUserApi; import com.ning.billing.account.api.MockAccountUserApi; import com.ning.billing.catalog.DefaultCatalogService; import com.ning.billing.catalog.api.CatalogService; import com.ning.billing.config.CatalogConfig; import com.ning.billing.config.InvoiceConfig; import com.ning.billing.dbi.MysqlTestingHelper; import com.ning.billing.entitlement.api.SubscriptionApiService; import com.ning.billing.entitlement.api.SubscriptionFactory; import com.ning.billing.entitlement.api.billing.ChargeThruApi; import com.ning.billing.entitlement.api.repair.RepairEntitlementLifecycleDao; import com.ning.billing.entitlement.api.repair.RepairSubscriptionApiService; import com.ning.billing.entitlement.api.repair.RepairSubscriptionFactory; import com.ning.billing.entitlement.api.user.DefaultEntitlementUserApi; import com.ning.billing.entitlement.api.user.DefaultSubscriptionApiService; import com.ning.billing.entitlement.api.user.DefaultSubscriptionFactory; import com.ning.billing.entitlement.api.user.EntitlementUserApi; import com.ning.billing.entitlement.api.user.Subscription; import com.ning.billing.entitlement.engine.dao.EntitlementDao; import com.ning.billing.entitlement.engine.dao.EntitlementSqlDao; import com.ning.billing.entitlement.engine.dao.RepairEntitlementDao; import com.ning.billing.entitlement.glue.EntitlementModule; import com.ning.billing.invoice.InvoiceDispatcher; import com.ning.billing.invoice.InvoiceListener; import com.ning.billing.invoice.api.InvoiceNotifier; import com.ning.billing.invoice.dao.DefaultInvoiceDao; import com.ning.billing.invoice.dao.InvoiceDao; import com.ning.billing.invoice.model.DefaultInvoiceGenerator; import com.ning.billing.invoice.model.InvoiceGenerator; import com.ning.billing.junction.api.BillingApi; import com.ning.billing.junction.plumbing.billing.DefaultBillingApi; import com.ning.billing.lifecycle.KillbillService; import com.ning.billing.mock.BrainDeadProxyFactory; import com.ning.billing.mock.BrainDeadProxyFactory.ZombieControl; import com.ning.billing.util.bus.Bus; import com.ning.billing.util.bus.InMemoryBus; import com.ning.billing.util.callcontext.CallContextFactory; import com.ning.billing.util.callcontext.DefaultCallContextFactory; import com.ning.billing.util.clock.Clock; import com.ning.billing.util.clock.ClockMock; import com.ning.billing.util.customfield.dao.AuditedCustomFieldDao; import com.ning.billing.util.customfield.dao.CustomFieldDao; import com.ning.billing.util.globallocker.GlobalLocker; import com.ning.billing.util.globallocker.MySqlGlobalLocker; import com.ning.billing.util.notificationq.DefaultNotificationQueueService; import com.ning.billing.util.notificationq.DummySqlTest; import com.ning.billing.util.notificationq.NotificationQueueService; import com.ning.billing.util.notificationq.dao.NotificationSqlDao; import com.ning.billing.util.tag.dao.AuditedTagDao; import com.ning.billing.util.tag.dao.TagDao; <<<<<<< ======= import com.ning.billing.entitlement.api.repair.RepairEntitlementLifecycleDao; import com.ning.billing.entitlement.api.repair.RepairSubscriptionApiService; import com.ning.billing.entitlement.api.repair.RepairSubscriptionFactory; import com.ning.billing.entitlement.api.user.DefaultEntitlementUserApi; import com.ning.billing.entitlement.api.user.DefaultSubscriptionApiService; import com.ning.billing.entitlement.api.user.DefaultSubscriptionFactory; >>>>>>> import com.ning.billing.entitlement.api.repair.RepairEntitlementLifecycleDao; import com.ning.billing.entitlement.api.repair.RepairSubscriptionApiService; import com.ning.billing.entitlement.api.repair.RepairSubscriptionFactory; import com.ning.billing.entitlement.api.user.DefaultEntitlementUserApi; import com.ning.billing.entitlement.api.user.DefaultSubscriptionApiService; import com.ning.billing.entitlement.api.user.DefaultSubscriptionFactory; <<<<<<< import com.ning.billing.invoice.InvoiceDispatcher; ======= import com.ning.billing.entitlement.engine.dao.EntitlementDao; import com.ning.billing.entitlement.engine.dao.EntitlementSqlDao; import com.ning.billing.entitlement.engine.dao.RepairEntitlementDao; import com.ning.billing.entitlement.glue.EntitlementModule; >>>>>>> import com.ning.billing.entitlement.engine.dao.EntitlementDao; import com.ning.billing.entitlement.engine.dao.EntitlementSqlDao; import com.ning.billing.entitlement.engine.dao.RepairEntitlementDao; import com.ning.billing.entitlement.glue.EntitlementModule; import com.ning.billing.invoice.InvoiceDispatcher; <<<<<<< ======= bind(EntitlementDao.class).to(EntitlementSqlDao.class).asEagerSingleton(); bind(EntitlementDao.class).annotatedWith(Names.named(EntitlementModule.REPAIR_NAMED)).to(RepairEntitlementDao.class); bind(RepairEntitlementLifecycleDao.class).annotatedWith(Names.named(EntitlementModule.REPAIR_NAMED)).to(RepairEntitlementDao.class); bind(RepairEntitlementDao.class).asEagerSingleton(); >>>>>>> bind(EntitlementDao.class).to(EntitlementSqlDao.class).asEagerSingleton(); bind(EntitlementDao.class).annotatedWith(Names.named(EntitlementModule.REPAIR_NAMED)).to(RepairEntitlementDao.class); bind(RepairEntitlementLifecycleDao.class).annotatedWith(Names.named(EntitlementModule.REPAIR_NAMED)).to(RepairEntitlementDao.class); bind(RepairEntitlementDao.class).asEagerSingleton(); <<<<<<< bind(BillingApi.class).toInstance(BrainDeadProxyFactory.createBrainDeadProxyFor(BillingApi.class)); ======= bind(AccountUserApi.class).to(MockAccountUserApi.class).asEagerSingleton(); bind(SubscriptionApiService.class).annotatedWith(Names.named(EntitlementModule.REPAIR_NAMED)).to(RepairSubscriptionApiService.class).asEagerSingleton(); bind(SubscriptionApiService.class).to(DefaultSubscriptionApiService.class).asEagerSingleton(); bind(SubscriptionFactory.class).annotatedWith(Names.named(EntitlementModule.REPAIR_NAMED)).to(RepairSubscriptionFactory.class).asEagerSingleton(); bind(SubscriptionFactory.class).to(DefaultSubscriptionFactory.class).asEagerSingleton(); bind(BillingApi.class).to(DefaultBillingApi.class).asEagerSingleton(); bind(EntitlementUserApi.class).to(DefaultEntitlementUserApi.class).asEagerSingleton(); >>>>>>> bind(AccountUserApi.class).to(MockAccountUserApi.class).asEagerSingleton(); bind(SubscriptionApiService.class).annotatedWith(Names.named(EntitlementModule.REPAIR_NAMED)).to(RepairSubscriptionApiService.class).asEagerSingleton(); bind(SubscriptionApiService.class).to(DefaultSubscriptionApiService.class).asEagerSingleton(); bind(SubscriptionFactory.class).annotatedWith(Names.named(EntitlementModule.REPAIR_NAMED)).to(RepairSubscriptionFactory.class).asEagerSingleton(); bind(SubscriptionFactory.class).to(DefaultSubscriptionFactory.class).asEagerSingleton(); bind(BillingApi.class).to(DefaultBillingApi.class).asEagerSingleton(); bind(EntitlementUserApi.class).to(DefaultEntitlementUserApi.class).asEagerSingleton(); <<<<<<< AccountUserApi accountUserApi = BrainDeadProxyFactory.createBrainDeadProxyFor(AccountUserApi.class); bind(AccountUserApi.class).toInstance(accountUserApi); EntitlementUserApi entitlementUserApi = BrainDeadProxyFactory.createBrainDeadProxyFor(EntitlementUserApi.class); bind(EntitlementUserApi.class).toInstance(entitlementUserApi); ======= >>>>>>>
<<<<<<< * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved. ======= * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved. >>>>>>> * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved. <<<<<<< if ((len % blockSize) != 0) { throw new ProviderException("Internal error in input buffering"); } ======= checkDataLength(processed, len); >>>>>>> checkDataLength(processed, len); if ((len % blockSize) != 0) { throw new ProviderException("Internal error in input buffering"); } <<<<<<< if ((len % blockSize) != 0) { throw new ProviderException("Internal error in input buffering"); } ======= checkDataLength(ibuffer.size(), len); >>>>>>> checkDataLength(ibuffer.size(), len); if ((len % blockSize) != 0) { throw new ProviderException("Internal error in input buffering"); }
<<<<<<< protected boolean isSuspended; protected volatile Thread editorThread; // volatile because the variable can be get/set by either the vst thread or the editor thread ======= protected boolean isTurnedOff; >>>>>>> protected volatile Thread editorThread; // volatile because the variable can be get/set by either the vst thread or the editor thread protected boolean isTurnedOff;
<<<<<<< import hudson.model.TaskListener; import hudson.scm.ChangeLogParser; import hudson.scm.NullSCM; import hudson.scm.PollingResult; import hudson.scm.SCM; import hudson.scm.SCMRevisionState; ======= import hudson.tasks.JavadocArchiver; >>>>>>> import hudson.model.TaskListener; import hudson.scm.ChangeLogParser; import hudson.scm.NullSCM; import hudson.scm.PollingResult; import hudson.scm.SCM; import hudson.scm.SCMRevisionState; import hudson.tasks.JavadocArchiver;
<<<<<<< protected JSONCompareResult fail(String field, Object expected, Object actual) { ======= protected void fail(String field, Object expected, Object actual) { _fieldFailures.add(new FieldComparisonFailure(field, expected, actual)); >>>>>>> protected JSONCompareResult fail(String field, Object expected, Object actual) { _fieldFailures.add(new FieldComparisonFailure(field, expected, actual));
<<<<<<< Mask mask = Mask.BandMathsType.create(indexBandInformation.getPrefix() + indexName.toLowerCase(), description, product.getSceneRasterWidth(), product.getSceneRasterHeight(), ======= Mask mask = Mask.BandMathsType.create("scl_" + indexName.toLowerCase(), description, dimension.width, dimension.height, >>>>>>> Mask mask = Mask.BandMathsType.create(indexBandInformation.getPrefix() + indexName.toLowerCase(), description, dimension.width, dimension.height,
<<<<<<< GeoCoding bandDefaultGeoCoding = metadata.buildProductGeoCoding(null); subProductBounds = subsetDef.getSubsetRegion().computeBandPixelRegion(productDefaultGeoCoding, bandDefaultGeoCoding, defaultProductSize.width, defaultProductSize.height, defaultSubProductSize.width, defaultSubProductSize.height, isMultiSize); ======= subProductDefaultGeoCoding = subProductTileMetadataList.buildProductGeoCoding(null); Rectangle subProductBounds = subsetDef.getSubsetRegion().computeBandPixelRegion(productDefaultGeoCoding, subProductDefaultGeoCoding, defaultProductSize.width, defaultProductSize.height, defaultSubProductSize.width, defaultSubProductSize.height); subProductGeoCoding = subProductTileMetadataList.buildProductGeoCoding(subProductBounds); >>>>>>> subProductDefaultGeoCoding = subProductTileMetadataList.buildProductGeoCoding(null); Rectangle subProductBounds = subsetDef.getSubsetRegion().computeBandPixelRegion(productDefaultGeoCoding, subProductDefaultGeoCoding, defaultProductSize.width, defaultProductSize.height, defaultSubProductSize.width, defaultSubProductSize.height, isMultiSize); subProductGeoCoding = subProductTileMetadataList.buildProductGeoCoding(subProductBounds); <<<<<<< Band band = buildBand(defaultProductSize, mosaicMatrix, bandsDataType, bandName, bandIndex, tileMetadata, subProductGeoCoding, preferredTileSize, productDefaultGeoCoding, subsetDef, isMultiSize); ======= // use the default product size to compute the band of a subproduct because the subset region // is set according to the default product size Band band = buildSubProductBand(defaultProductSize, subProductDefaultGeoCoding, subProductMosaicMatrix, bandsDataType, bandName, bandIndex, tileMetadata, subProductGeoCoding, preferredTileSize, subsetDef); >>>>>>> // use the default product size to compute the band of a subproduct because the subset region // is set according to the default product size Band band = buildSubProductBand(defaultProductSize, subProductDefaultGeoCoding, subProductMosaicMatrix, bandsDataType, bandName, bandIndex, tileMetadata, subProductGeoCoding, preferredTileSize, subsetDef, isMultiSize); <<<<<<< private static Band buildBand(Dimension defaultProductSize, MosaicMatrix mosaicMatrix, int bandDataType, String bandName, int bandIndex, TileMetadata tileMetadata, GeoCoding subProductGeoCoding, Dimension preferredTileSize, GeoCoding productDefaultGeoCoding, ProductSubsetDef subsetDef, boolean isMultiSize) ======= private static Band buildSubProductBand(Dimension defaultProductSize, GeoCoding subProductDefaultGeoCoding, MosaicMatrix subProductMosaicMatrix, int bandDataType, String bandName, int bandIndex, TileMetadata tileMetadata, GeoCoding subProductGeoCoding, Dimension preferredTileSize, ProductSubsetDef subsetDef) >>>>>>> private static Band buildSubProductBand(Dimension defaultProductSize, GeoCoding subProductDefaultGeoCoding, MosaicMatrix subProductMosaicMatrix, int bandDataType, String bandName, int bandIndex, TileMetadata tileMetadata, GeoCoding subProductGeoCoding, Dimension preferredTileSize, ProductSubsetDef subsetDef, boolean isMultiSize) <<<<<<< bandBounds = subsetDef.getSubsetRegion().computeBandPixelRegion(productDefaultGeoCoding, bandDefaultGeoCoding, defaultProductSize.width, defaultProductSize.height, defaultBandWidth, defaultBandHeight, isMultiSize); ======= bandBounds = subsetDef.getSubsetRegion().computeBandPixelRegion(subProductDefaultGeoCoding, bandDefaultGeoCoding, defaultProductSize.width, defaultProductSize.height, defaultBandWidth, defaultBandHeight); >>>>>>> bandBounds = subsetDef.getSubsetRegion().computeBandPixelRegion(subProductDefaultGeoCoding, bandDefaultGeoCoding, defaultProductSize.width, defaultProductSize.height, defaultBandWidth, defaultBandHeight, isMultiSize);
<<<<<<< private final Rectangle subsetRegion; private VirtualJP2File virtualInputFile; private final int tileStartX; private final int tileStartY; private int numTilesX; private int numTilesY; ======= private final JP2ImageFile jp2ImageFile; private final Path localCacheFolder; >>>>>>> private final Rectangle subsetRegion; private final JP2ImageFile jp2ImageFile; private final Path localCacheFolder; private final int tileStartX; private final int tileStartY; private int numTilesX; private int numTilesY; <<<<<<< public JP2MultiLevelSource(VirtualJP2File virtualInputFile, int bandIndex, int numBands, ======= public JP2MultiLevelSource(Path localCacheFolder, JP2ImageFile jp2ImageFile, int bandIndex, int numBands, >>>>>>> public JP2MultiLevelSource(Path localCacheFolder, JP2ImageFile jp2ImageFile, int bandIndex, int numBands, <<<<<<< private PlanarImage createTileImage(Path localImageFile, Path localCacheFolder, int row, int col, int level, Point tileOffset) throws IOException { ======= private PlanarImage createTileImage(JP2ImageFile jp2ImageFile, Path localCacheFolder, int row, int col, int level) throws IOException { >>>>>>> private PlanarImage createTileImage(JP2ImageFile jp2ImageFile, Path localCacheFolder, int row, int col, int level, Point tileOffset) throws IOException { <<<<<<< return JP2TileOpImage.create(localImageFile, localCacheFolder, bandIndex, row, col, currentLayout, getModel(), dataType, level, tileOffset); ======= return JP2TileOpImage.create(jp2ImageFile, localCacheFolder, bandIndex, row, col, currentLayout, getModel(), dataType, level); >>>>>>> return JP2TileOpImage.create(jp2ImageFile, localCacheFolder, bandIndex, row, col, currentLayout, getModel(), dataType, level, tileOffset); <<<<<<< if (localImageFile == null) { localImageFile = this.virtualInputFile.getLocalFile(); // compute only one time the file path } opImage = createTileImage(localImageFile, this.virtualInputFile.getLocalCacheFolder(), x, y, level, tileOffset); ======= opImage = createTileImage(jp2ImageFile, this.localCacheFolder, x, y, level); >>>>>>> opImage = createTileImage(jp2ImageFile, this.localCacheFolder, x, y, level, tileOffset);
<<<<<<< //used to identify the bands selected by the user in Advanced Open dialog //default is true, because the product can be opened without advanced option (in this case all the bands should be opened) boolean bandIsSelected = true; String bandName = "band_" + (bandIdx + 1); if (getSubsetDef() != null && !Arrays.asList(getSubsetDef().getNodeNames()).contains("allBands")) { if (!Arrays.asList(getSubsetDef().getNodeNames()).contains(bandName)) { bandIsSelected = false; } } if (bandIsSelected) { // changes from https://github.com/senbox-org/s2tbx/pull/48 /*int precision = imageInfo.getComponents().get(bandIdx).getPrecision(); Band virtualBand = new Band("band_" + String.valueOf(bandIdx + 1), OpenJpegUtils.PRECISION_TYPE_MAP.get(precision), imageWidth, imageHeight);*/ ImageInfo.ImageInfoComponent bandImageInfo = imageInfo.getComponents().get(bandIdx); int snapDataType = getSnapDataTypeFromImageInfo(bandImageInfo); int awtDataType = getAwtDataTypeFromImageInfo(bandImageInfo); Band virtualBand = new Band("band_" + (bandIdx + 1), snapDataType, imageWidth, imageHeight); JP2MultiLevelSource source = new JP2MultiLevelSource(this.virtualJp2File, bandIdx, numBands, imageWidth, imageHeight, csInfo.getTileWidth(), csInfo.getTileHeight(), csInfo.getNumTilesX(), csInfo.getNumTilesY(), csInfo.getNumResolutions(), awtDataType, this.product.getSceneGeoCoding(), subsetRegion); virtualBand.setSourceImage(new DefaultMultiLevelImage(source)); if (bandScales != null && bandOffsets != null) { virtualBand.setScalingFactor(bandScales[bandIdx]); virtualBand.setScalingOffset(bandOffsets[bandIdx]); } this.product.addBand(virtualBand); ======= // changes from https://github.com/senbox-org/s2tbx/pull/48 /*int precision = imageInfo.getComponents().get(bandIdx).getPrecision(); Band virtualBand = new Band("band_" + String.valueOf(bandIdx + 1), OpenJpegUtils.PRECISION_TYPE_MAP.get(precision), imageWidth, imageHeight);*/ ImageInfo.ImageInfoComponent bandImageInfo = imageInfo.getComponents().get(bandIdx); int snapDataType = getSnapDataTypeFromImageInfo(bandImageInfo); int awtDataType = getAwtDataTypeFromImageInfo(bandImageInfo); Band virtualBand = new Band("band_" + (bandIdx + 1), snapDataType, imageWidth, imageHeight); JP2MultiLevelSource source = new JP2MultiLevelSource(localCacheFolder, jp2ImageFile, bandIdx, numBands, imageWidth, imageHeight, csInfo.getTileWidth(), csInfo.getTileHeight(), csInfo.getNumTilesX(), csInfo.getNumTilesY(), csInfo.getNumResolutions(), awtDataType, this.product.getSceneGeoCoding()); virtualBand.setSourceImage(new DefaultMultiLevelImage(source)); if (bandScales != null && bandOffsets != null) { virtualBand.setScalingFactor(bandScales[bandIdx]); virtualBand.setScalingOffset(bandOffsets[bandIdx]); >>>>>>> //used to identify the bands selected by the user in Advanced Open dialog //default is true, because the product can be opened without advanced option (in this case all the bands should be opened) boolean bandIsSelected = true; String bandName = "band_" + (bandIdx + 1); if (getSubsetDef() != null && !Arrays.asList(getSubsetDef().getNodeNames()).contains("allBands")) { if (!Arrays.asList(getSubsetDef().getNodeNames()).contains(bandName)) { bandIsSelected = false; } } if (bandIsSelected) { // changes from https://github.com/senbox-org/s2tbx/pull/48 /*int precision = imageInfo.getComponents().get(bandIdx).getPrecision(); Band virtualBand = new Band("band_" + String.valueOf(bandIdx + 1), OpenJpegUtils.PRECISION_TYPE_MAP.get(precision), imageWidth, imageHeight);*/ ImageInfo.ImageInfoComponent bandImageInfo = imageInfo.getComponents().get(bandIdx); int snapDataType = getSnapDataTypeFromImageInfo(bandImageInfo); int awtDataType = getAwtDataTypeFromImageInfo(bandImageInfo); Band virtualBand = new Band("band_" + (bandIdx + 1), snapDataType, imageWidth, imageHeight); JP2MultiLevelSource source = new JP2MultiLevelSource(localCacheFolder, jp2ImageFile, bandIdx, numBands, imageWidth, imageHeight, csInfo.getTileWidth(), csInfo.getTileHeight(), csInfo.getNumTilesX(), csInfo.getNumTilesY(), csInfo.getNumResolutions(), awtDataType, this.product.getSceneGeoCoding(), subsetRegion); virtualBand.setSourceImage(new DefaultMultiLevelImage(source)); if (bandScales != null && bandOffsets != null) { virtualBand.setScalingFactor(bandScales[bandIdx]); virtualBand.setScalingOffset(bandOffsets[bandIdx]); } this.product.addBand(virtualBand);
<<<<<<< import org.esa.snap.dataio.FileImageInputStreamSpi; ======= import org.esa.s2tbx.dataio.FileImageInputStreamSpi; import org.esa.s2tbx.dataio.ICallbackCommand; >>>>>>> import org.esa.s2tbx.dataio.ICallbackCommand; import org.esa.snap.dataio.FileImageInputStreamSpi;
<<<<<<< import org.esa.lib.gdal.activator.GDALDistributionInstaller; import org.esa.lib.gdal.activator.GDALInstallInfo; import org.esa.s2tbx.gdal.reader.plugins.AbstractDriverProductReaderPlugIn; ======= import org.esa.s2tbx.dataio.gdal.GDALLoader; import org.esa.s2tbx.dataio.gdal.activator.GDALInstallInfo; >>>>>>> import org.esa.lib.gdal.activator.GDALInstallInfo; import org.esa.s2tbx.dataio.gdal.GDALLoader; import org.esa.s2tbx.gdal.reader.plugins.AbstractDriverProductReaderPlugIn;
<<<<<<< import java.util.Optional; ======= import java.io.Serializable; >>>>>>> import java.io.Serializable; import java.util.Optional; <<<<<<< protected Optional<QueryLookupStrategy> getQueryLookupStrategy(QueryLookupStrategy.Key key, EvaluationContextProvider evaluationContextProvider) { return Optional.of(new HazelcastQueryLookupStrategy(key, evaluationContextProvider, this.keyValueOperations, this.queryCreator)); ======= protected QueryLookupStrategy getQueryLookupStrategy(QueryLookupStrategy.Key key, EvaluationContextProvider evaluationContextProvider) { return new HazelcastQueryLookupStrategy(key, evaluationContextProvider, keyValueOperations, queryCreator, hazelcastInstance); >>>>>>> protected QueryLookupStrategy getQueryLookupStrategy(QueryLookupStrategy.Key key, EvaluationContextProvider evaluationContextProvider) { return new HazelcastQueryLookupStrategy(key, evaluationContextProvider, keyValueOperations, queryCreator, hazelcastInstance);
<<<<<<< private HazelcastInstance hzInstance; public HazelcastKeyValueAdapter() { this(Hazelcast.getOrCreateHazelcastInstance(new Config(Constants.HAZELCAST_INSTANCE_NAME))); } public HazelcastKeyValueAdapter(HazelcastInstance hzInstance) { super(new HazelcastQueryEngine()); Assert.notNull(hzInstance, "hzInstance must not be 'null'."); this.hzInstance = hzInstance; } public void setHzInstance(HazelcastInstance hzInstance) { this.hzInstance = hzInstance; } @Override public Object put(Object id, Object item, String keyspace) { Assert.notNull(id, "Id must not be 'null' for adding."); Assert.notNull(item, "Item must not be 'null' for adding."); return getMap(keyspace).put(id, item); } @Override public boolean contains(Object id, String keyspace) { return getMap(keyspace).containsKey(id); } @Override public Object get(Object id, String keyspace) { return getMap(keyspace).get(id); } @Override public Object delete(Object id, String keyspace) { return getMap(keyspace).remove(id); } @Override public Iterable<?> getAllOf(String keyspace) { return getMap(keyspace).values(); } @Override public void deleteAllOf(String keyspace) { getMap(keyspace).clear(); } @Override public void clear() { this.hzInstance.shutdown(); } protected IMap<Object, Object> getMap(final String keyspace) { return hzInstance.getMap(keyspace); } @Override public void destroy() { this.clear(); } @Override public long count(String keyspace) { return getMap(keyspace).size(); } @Override public CloseableIterator<Map.Entry<Object, Object>> entries(String keyspace) { Iterator<Entry<Object, Object>> iterator = this.getMap(keyspace).entrySet().iterator(); return new ForwardingCloseableIterator<>(iterator); } ======= private HazelcastInstance hzInstance; /** * Creates an instance of {@link HazelcastKeyValueAdapter}. * * @deprecated Use {@code new HazelcastKeyValueAdapter(Hazelcast.getOrCreateHazelcastInstance(new Config(Constants * .HAZELCAST_INSTANCE_NAME))} instead. This method will be removed in a future release. */ @Deprecated public HazelcastKeyValueAdapter() { this(Hazelcast.getOrCreateHazelcastInstance(new Config(Constants.HAZELCAST_INSTANCE_NAME))); } public HazelcastKeyValueAdapter(HazelcastInstance hzInstance) { super(new HazelcastQueryEngine()); Assert.notNull(hzInstance, "hzInstance must not be 'null'."); this.hzInstance = hzInstance; } public void setHzInstance(HazelcastInstance hzInstance) { this.hzInstance = hzInstance; } @SuppressWarnings("unchecked") @Override public Object put(Serializable id, Object item, Serializable keyspace) { Assert.notNull(id, "Id must not be 'null' for adding."); Assert.notNull(item, "Item must not be 'null' for adding."); return getMap(keyspace).put(id, item); } @Override public boolean contains(Serializable id, Serializable keyspace) { return getMap(keyspace).containsKey(id); } @Override public Object get(Serializable id, Serializable keyspace) { return getMap(keyspace).get(id); } @Override public Object delete(Serializable id, Serializable keyspace) { return getMap(keyspace).remove(id); } @Override public Collection<?> getAllOf(Serializable keyspace) { return getMap(keyspace).values(); } @Override public void deleteAllOf(Serializable keyspace) { getMap(keyspace).clear(); } @Override public void clear() { this.hzInstance.shutdown(); } @SuppressWarnings("rawtypes") protected IMap getMap(final Serializable keyspace) { Assert.isInstanceOf(String.class, keyspace, "Keyspace identifier must of type String."); return hzInstance.getMap((String) keyspace); } @Override public void destroy() throws Exception { this.clear(); } @Override public long count(Serializable keyspace) { return this.getMap(keyspace).size(); } @SuppressWarnings("unchecked") @Override public CloseableIterator<Entry<Serializable, Object>> entries(Serializable keyspace) { Iterator<Entry<Serializable, Object>> iterator = this.getMap(keyspace).entrySet().iterator(); return new ForwardingCloseableIterator<Entry<Serializable, Object>>(iterator); } >>>>>>> private HazelcastInstance hzInstance; /** * Creates an instance of {@link HazelcastKeyValueAdapter}. * * @deprecated Use {@code new HazelcastKeyValueAdapter(Hazelcast.getOrCreateHazelcastInstance(new Config(Constants * .HAZELCAST_INSTANCE_NAME))} instead. This method will be removed in a future release. */ @Deprecated public HazelcastKeyValueAdapter() { this(Hazelcast.getOrCreateHazelcastInstance(new Config(Constants.HAZELCAST_INSTANCE_NAME))); } public HazelcastKeyValueAdapter(HazelcastInstance hzInstance) { super(new HazelcastQueryEngine()); Assert.notNull(hzInstance, "hzInstance must not be 'null'."); this.hzInstance = hzInstance; } public void setHzInstance(HazelcastInstance hzInstance) { this.hzInstance = hzInstance; } @Override public Object put(Object id, Object item, String keyspace) { Assert.notNull(id, "Id must not be 'null' for adding."); Assert.notNull(item, "Item must not be 'null' for adding."); return getMap(keyspace).put(id, item); } @Override public boolean contains(Object id, String keyspace) { return getMap(keyspace).containsKey(id); } @Override public Object get(Object id, String keyspace) { return getMap(keyspace).get(id); } @Override public Object delete(Object id, String keyspace) { return getMap(keyspace).remove(id); } @Override public Iterable<?> getAllOf(String keyspace) { return getMap(keyspace).values(); } @Override public void deleteAllOf(String keyspace) { getMap(keyspace).clear(); } @Override public void clear() { this.hzInstance.shutdown(); } protected IMap<Object, Object> getMap(final String keyspace) { return hzInstance.getMap(keyspace); } @Override public void destroy() { this.clear(); } @Override public long count(String keyspace) { return getMap(keyspace).size(); } @Override public CloseableIterator<Map.Entry<Object, Object>> entries(String keyspace) { Iterator<Entry<Object, Object>> iterator = this.getMap(keyspace).entrySet().iterator(); return new ForwardingCloseableIterator<>(iterator); }
<<<<<<< final Long keepLastFrame, final File output, final String attribution, final int fontSize, final String fontName, final String fontStyle, final Double markerSize, final Double waypointSize, ======= final Long keepLastFrame, final File output, final String attribution, final SpeedUnit speedUnit, final int fontSize, final Double markerSize, final Double waypointSize, >>>>>>> final Long keepLastFrame, final File output, final String attribution, final SpeedUnit speedUnit, final int fontSize, final String fontName, final String fontStyle, final Double markerSize, final Double waypointSize, <<<<<<< ======= this.photoAnimationDuration = photoAnimationDuration; this.speedUnit = speedUnit; >>>>>>> this.photoAnimationDuration = photoAnimationDuration; this.speedUnit = speedUnit; <<<<<<< ======= private Long photoAnimationDuration = DEFAULT_PHOTO_ANIMATION_DURATION; private SpeedUnit speedUnit; >>>>>>> private Long photoAnimationDuration = DEFAULT_PHOTO_ANIMATION_DURATION; private SpeedUnit speedUnit; <<<<<<< keepLastFrame, output, attribution, fontSize, fontName, fontStyle, markerSize, waypointSize, minLon, maxLon, minLat, maxLat, logo, logoPosition, attributionPosition, informationPosition, photoDirectory, photoTime, ======= keepLastFrame, output, attribution, speedUnit, fontSize, markerSize, waypointSize, minLon, maxLon, minLat, maxLat, logo, photoDirectory, photoTime, photoAnimationDuration, >>>>>>> keepLastFrame, output, attribution, speedUnit, fontSize, fontName, fontStyle, markerSize, waypointSize, minLon, maxLon, minLat, maxLat, photoAnimationDuration, logo, logoPosition, attributionPosition, informationPosition, photoDirectory, photoTime,
<<<<<<< private Long minimumRequestRetryRandomDelayMilliseconds; private Long maximumRequestRetryRandomDelayMilliseconds; private Long maximumRequestRetryTimeoutMilliseconds; private final ShopifySdkRetryListener shopifySdkRetryListener = new ShopifySdkRetryListener(); ======= private long minimumRequestRetryRandomDelayMilliseconds; private long maximumRequestRetryRandomDelayMilliseconds; private long maximumRequestRetryTimeoutMilliseconds; >>>>>>> private long minimumRequestRetryRandomDelayMilliseconds; private long maximumRequestRetryRandomDelayMilliseconds; private long maximumRequestRetryTimeoutMilliseconds; <<<<<<< public String getResponseBody() { return responseBody; } ======= private static final String RETRY_EXCEPTION_ATTEMPT_MESSAGE = "An exception occurred while making an API call to shopify on attempt number {} and {} seconds since first attempt with exception {}"; private static final String RETRY_INVALID_RESPONSE_ATTEMPT_MESSAGE = "Waited {} seconds since first retry attempt. This is attempt {}. Please review the following failed request information.\nRequest Location of {}\nResponse Status Code of {}\nResponse Headers of:\n{}\nResponse Body of:\n{}"; >>>>>>> public String getResponseBody() { return responseBody; } private static final String RETRY_EXCEPTION_ATTEMPT_MESSAGE = "An exception occurred while making an API call to shopify on attempt number {} and {} seconds since first attempt with exception {}"; private static final String RETRY_INVALID_RESPONSE_ATTEMPT_MESSAGE = "Waited {} seconds since first retry attempt. This is attempt {}. Please review the following failed request information.\nRequest Location of {}\nResponse Status Code of {}\nResponse Headers of:\n{}\nResponse Body of:\n{}";
<<<<<<< import java.io.PrintWriter; ======= import java.io.IOException; >>>>>>> import java.io.IOException; import java.io.PrintWriter; <<<<<<< public void error(JavaFileObject source, int pos, String key, Object ... args) { Log log = log(); JavaFileObject prev = log.useSource(source); try { log.error(pos, key, args); } finally { log.useSource(prev); } } public void error(JavaFileObject source, DiagnosticPosition pos, String key, Object ... args) { Log log = log(); JavaFileObject prev = log.useSource(source); try { log.error(pos, key, args); } finally { log.useSource(prev); } } public void errorAndAssociatedDeclaration(JavaFileObject source, int pos, JavaFileObject assoc, int assocpos, String key, Object ... args) { Log log = log(); JavaFileObject prev = log.useSource(source); try { log.error(pos, key, args); } finally { log.useSource(prev); } prev = log.useSource(assoc); try { log.error(assocpos, "jml.associated.decl.cf", locationString(pos, source)); } finally { log.useSource(prev); } } public void errorAndAssociatedDeclaration(JavaFileObject source, DiagnosticPosition pos, JavaFileObject assoc, DiagnosticPosition assocpos, String key, Object ... args) { Log log = log(); JavaFileObject prev = log.useSource(source); try { log.error(pos, key, args); } finally { log.useSource(prev); } prev = log.useSource(assoc); try { log.error(assocpos, "jml.associated.decl.cf", locationString(pos, source)); } finally { log.useSource(prev); } } ======= /** * Checks to see if two JavaFileObjects point to the same location. * In some cases, it's a bad idea to use JavaFileObject.equals, because copying a JavaFileObject can change the path name, even if they point to the same canonical path. * This function exists for where JavaFileObject.equals may fail. */ public static boolean ifSourcesEqual(JavaFileObject jfo1, JavaFileObject jfo2) { try { File file1 = new File(jfo1.getName()); File file2 = new File(jfo2.getName()); return file1.getCanonicalPath().equals(file2.getCanonicalPath()); } catch (IOException e) {} return jfo1.equals(jfo2); } >>>>>>> public void error(JavaFileObject source, int pos, String key, Object ... args) { Log log = log(); JavaFileObject prev = log.useSource(source); try { log.error(pos, key, args); } finally { log.useSource(prev); } } public void error(JavaFileObject source, DiagnosticPosition pos, String key, Object ... args) { Log log = log(); JavaFileObject prev = log.useSource(source); try { log.error(pos, key, args); } finally { log.useSource(prev); } } public void errorAndAssociatedDeclaration(JavaFileObject source, int pos, JavaFileObject assoc, int assocpos, String key, Object ... args) { Log log = log(); JavaFileObject prev = log.useSource(source); try { log.error(pos, key, args); } finally { log.useSource(prev); } prev = log.useSource(assoc); try { log.error(assocpos, "jml.associated.decl.cf", locationString(pos, source)); } finally { log.useSource(prev); } } public void errorAndAssociatedDeclaration(JavaFileObject source, DiagnosticPosition pos, JavaFileObject assoc, DiagnosticPosition assocpos, String key, Object ... args) { Log log = log(); JavaFileObject prev = log.useSource(source); try { log.error(pos, key, args); } finally { log.useSource(prev); } prev = log.useSource(assoc); try { log.error(assocpos, "jml.associated.decl.cf", locationString(pos, source)); } finally { log.useSource(prev); } }
<<<<<<< if ((infer || esc) && heapSym == null) { JCVariableDecl d = treeutils.makeStaticVarDef(syms.intType,heapVarName,null, ======= // Declare the heap counter if (esc && heapSym == null) { JCVariableDecl d = treeutils.makeStaticVarDef(syms.intType,heapVarName,classDecl.sym, >>>>>>> // Declare the heap counter if ((infer || esc) && heapSym == null) { JCVariableDecl d = treeutils.makeStaticVarDef(syms.intType,heapVarName,classDecl.sym, <<<<<<< if (esc || infer) { ======= // FIXME - why is the following code inside the if (allocSym == null) block if (esc) { >>>>>>> // FIXME - why is the following code inside the if (allocSym == null) block if ((infer || esc)) { <<<<<<< if ((infer || esc) && (isConstructor || !utils.isJMLStatic(methodDecl.sym))) { currentStatements = initialStatements; ======= if (esc && (isConstructor || !utils.isJMLStatic(methodDecl.sym))) { currentStatements = initialStatements; // FIXME - an unnecessary assignment I think // assume 'this' is non-null and assume its type >>>>>>> if ((infer || esc) && (isConstructor || !utils.isJMLStatic(methodDecl.sym))) { currentStatements = initialStatements; // FIXME - an unnecessary assignment I think // assume 'this' is non-null and assume its type <<<<<<< if(esc || infer) { if (translatedExpr.toString().equals("e.cause != null")) Utils.stop(); ======= if (esc) { >>>>>>> if ((infer || esc)) { <<<<<<< protected JCVariableDecl newTempDecl(DiagnosticPosition pos, Type t) { Name n = M.Name(Strings.tmpVarString + (++count)); JCVariableDecl d = treeutils.makeVarDef(t, n, (esc || infer) ? null : methodDecl.sym , esc ? Position.NOPOS : pos.getPreferredPosition()); // FIXME - see note below ======= protected JmlVariableDecl newTempDecl(DiagnosticPosition pos, Type t) { return newTempDecl(pos, uniqueTempString(), t); } protected JmlVariableDecl newTempDecl(DiagnosticPosition pos, String s, Type t) { Name n = M.Name(s); JmlVariableDecl d = (JmlVariableDecl)treeutils.makeVarDef(t, n, esc ? null : methodDecl.sym , esc ? Position.NOPOS : pos.getPreferredPosition()); // FIXME - see note below >>>>>>> protected JmlVariableDecl newTempDecl(DiagnosticPosition pos, Type t) { return newTempDecl(pos, uniqueTempString(), t); } protected JmlVariableDecl newTempDecl(DiagnosticPosition pos, String s, Type t) { Name n = M.Name(s); JmlVariableDecl d = (JmlVariableDecl)treeutils.makeVarDef(t, n, esc ? null : methodDecl.sym , esc ? Position.NOPOS : pos.getPreferredPosition()); // FIXME - see note below <<<<<<< (esc || infer) ? null : methodDecl != null ? methodDecl.sym : classDecl.sym, expr); ======= esc ? null : methodDecl != null ? methodDecl.sym : classDecl.sym, expr); d.init = expr; // d.init = simplifyAndSave(d,expr); >>>>>>> (infer || esc) ? null : methodDecl != null ? methodDecl.sym : classDecl.sym, expr); d.init = expr; // d.init = simplifyAndSave(d,expr); <<<<<<< /* Declare new variables, initialized to the values of the formal * parameters, so that they can be referred to in postconditions and other invariant checks. */ if (!methodDecl.params.isEmpty()) addStat(comment(methodDecl,"Declare pre-state value of formals",null)); for (JCVariableDecl d: methodDecl.params) { JCVariableDecl dd = treeutils.makeVarDef(d.type,M.Name(Strings.formalPrefix+d.name.toString()), d.sym.owner, M.Ident(d.sym)); dd.pos = dd.sym.pos = d.sym.pos; preparams.put(d.sym,dd); if (esc || infer) dd.sym.owner = null; // FIXME - can get these straight from the labelmaps - do we need this? addStat(dd); // Declare allocation time of formals if they are not null if ((infer || esc) && !d.type.isPrimitive()) { JCIdent id = treeutils.makeIdent(d.pos, d.sym); JCExpression nn = treeutils.makeEqNull(d.pos,id); JCExpression fa = M.at(d.pos).Select(id, allocSym); fa = treeutils.makeBinary(d,JCTree.Tag.LE, fa, treeutils.makeIntLiteral(d,0)); fa = treeutils.makeOr(d.pos, nn, fa); addStat(treeutils.makeAssume(d, Label.IMPLICIT_ASSUME, fa )); } ======= { pushBlock(); addStat( comment(methodDecl,"Invariants for discovered fields",null)); discoveredFields = popBlock(0L,null); addStat(discoveredFields); alreadyDiscoveredFields.clear(); // FIXME - not going to work for nested method translations >>>>>>> { pushBlock(); addStat( comment(methodDecl,"Invariants for discovered fields",null)); discoveredFields = popBlock(0L,null); addStat(discoveredFields); alreadyDiscoveredFields.clear(); // FIXME - not going to work for nested method translations <<<<<<< if (esc || infer) { // Add nullness andtype conditions for fields and inherited fields addStat(comment(methodDecl,"Assume field type, allocation, and nullness",null)); addNullnessAndTypeConditionsForInheritedFields(classDecl.sym, isConstructor); ======= if (esc) { if (methodDecl.sym.isConstructor() || utils.isJMLStatic(methodDecl.sym)) { addStat(comment(methodDecl,"Assuming static initial state",null)); assumeStaticInitialState(classDecl.sym); } if (!methodDecl.sym.isConstructor()) { // Add nullness, type, and allocation conditions for fields and inherited fields addStat(comment(methodDecl,"Assume field type, allocation, and nullness",null)); addNullnessAndTypeConditionsForInheritedFields(classDecl.sym, isConstructor, currentThisExpr == null); } >>>>>>> if ((infer || esc)) { if (methodDecl.sym.isConstructor() || utils.isJMLStatic(methodDecl.sym)) { addStat(comment(methodDecl,"Assuming static initial state",null)); assumeStaticInitialState(classDecl.sym); } if (!methodDecl.sym.isConstructor()) { // Add nullness, type, and allocation conditions for fields and inherited fields addStat(comment(methodDecl,"Assume field type, allocation, and nullness",null)); addNullnessAndTypeConditionsForInheritedFields(classDecl.sym, isConstructor, currentThisExpr == null); } <<<<<<< // Assume invariants for the class of each field of the owning class JCExpression savedThis = currentThisExpr; for (JCTree dd: classDecl.defs) { if (!(dd instanceof JCVariableDecl)) continue; JCVariableDecl d = (JCVariableDecl)dd; if (d.sym.type.isPrimitive()) continue; if (!utils.isJMLStatic(d.sym) && utils.isJMLStatic(methodDecl.sym)) continue; if (isHelper(methodDecl.sym) && d.sym.type.tsym == methodDecl.sym.owner.type.tsym) continue; boolean pv = checkAccessEnabled; checkAccessEnabled = false; try { JCExpression fa = convertJML(treeutils.makeIdent(d.pos, d.sym)); addStat(comment(dd,"Adding invariants for " + d.sym,null)); addRecInvariants(true,d,fa); } finally { checkAccessEnabled = pv; } } currentThisExpr = savedThis; for (JmlTypeClauseDecl dd: specs.get(classDecl.sym).decls) { JCTree tt = dd.decl; if (!(tt instanceof JCVariableDecl)) continue; JCVariableDecl d = (JCVariableDecl)tt; if (d.sym.type.isPrimitive()) continue; if (!utils.isJMLStatic(d.sym) && utils.isJMLStatic(methodDecl.sym)) continue; JCExpression fa = convertJML(treeutils.makeIdent(d.pos, d.sym)); addStat(comment(dd,"Adding invariants for " + d.sym,null)); addRecInvariants(true,d,fa); ======= if (!methodDecl.sym.isConstructor()) { assumeFieldInvariants(this.methodDecl, classDecl); // FIXME - do parent classes also? >>>>>>> if (!methodDecl.sym.isConstructor()) { assumeFieldInvariants(this.methodDecl, classDecl); // FIXME - do parent classes also? <<<<<<< // This empty block with a null label marks the end of the pre-state if (esc || infer) { addStat(comment(methodDecl,"End of pre-state",null)); JCBlock bl = M.Block(0L, List.<JCStatement>nil()); JCStatement st = M.JmlLabeledStatement(null, null, bl); addStat(initialStats,st); } ======= >>>>>>> <<<<<<< Name resultname = names.fromString(Strings.conditionalResult + (++count)); JCVariableDecl vdecl = treeutils.makeVarDef(that.type, resultname, esc|| infer? null : methodDecl.sym, that.pos); addStat(vdecl); ======= Name resultname = names.fromString(Strings.conditionalResult + (++count)); JCVariableDecl vdecl = treeutils.makeVarDef(that.type, resultname, /*esc? null :*/ methodDecl.sym, that.pos); addStat(vdecl); >>>>>>> Name resultname = names.fromString(Strings.conditionalResult + (++count)); JCVariableDecl vdecl = treeutils.makeVarDef(that.type, resultname, /*esc? null :*/ methodDecl.sym, that.pos); addStat(vdecl); <<<<<<< if (esc || infer) { ++heapCount; ======= if (esc) { heapCount = nextHeapCount(); >>>>>>> if ((infer || esc)) { heapCount = nextHeapCount(); <<<<<<< if (!infer && specs.isNonNull(fa.sym,methodDecl.sym.enclClass())) { JCExpression e = treeutils.makeNeqObject(fa.pos, rhs, treeutils.nullLit); // FIXME - location of nnonnull declaration? addAssert(that, Label.POSSIBLY_NULL_ASSIGNMENT, e); ======= if (rhs instanceof JCTree.JCMemberReference) { // Need to check that the spec of the reference is subsumed in the spec of the type (that.type) inferred by type checking checkCompatibleSpecs((JCTree.JCMemberReference)rhs,rhs.type); } else if (rhs instanceof JCLambda) { // Need to check that the spec of the reference is subsumed in the spec of the type (that.type) inferred by type checking checkCompatibleSpecs((JCLambda)rhs,rhs.type); } else { if (specs.isNonNull(fa.sym,methodDecl.sym.enclClass())) { JCExpression e = treeutils.makeNeqObject(fa.pos, rhs, treeutils.nullLit); // FIXME - location of nnonnull declaration? addAssert(that, Label.POSSIBLY_NULL_ASSIGNMENT, e); } >>>>>>> if (rhs instanceof JCTree.JCMemberReference) { // Need to check that the spec of the reference is subsumed in the spec of the type (that.type) inferred by type checking checkCompatibleSpecs((JCTree.JCMemberReference)rhs,rhs.type); } else if (rhs instanceof JCLambda) { // Need to check that the spec of the reference is subsumed in the spec of the type (that.type) inferred by type checking checkCompatibleSpecs((JCLambda)rhs,rhs.type); } else { if (specs.isNonNull(fa.sym,methodDecl.sym.enclClass())) { JCExpression e = treeutils.makeNeqObject(fa.pos, rhs, treeutils.nullLit); // FIXME - location of nnonnull declaration? addAssert(that, Label.POSSIBLY_NULL_ASSIGNMENT, e); } <<<<<<< result = eresult = treeutils.makeBinary(that.pos,tag,that.getOperator(),lhs,rhs); } else if (tag == JCTree.Tag.PLUS && that.type.equals(syms.stringType)) { if (esc || infer) { ======= result = eresult = treeutils.makeBinary(that.pos,optag,that.getOperator(),lhs,rhs); } else if (optag == JCTree.Tag.PLUS && that.type.equals(syms.stringType)) { if (esc) { >>>>>>> result = eresult = treeutils.makeBinary(that.pos,optag,that.getOperator(),lhs,rhs); } else if (optag == JCTree.Tag.PLUS && that.type.equals(syms.stringType)) { if ((infer || esc)) { <<<<<<< result = eresult = treeutils.makeSelect(that.pos, trexpr, s); } else if ((esc || infer) && s != null && "class".equals(s.toString())) { result = eresult = treeutils.makeJavaTypelc(that.selected); ======= eee = newfa; } else if (esc && s != null && s.name == names._class) { eee = treeutils.makeJavaTypelc(that.selected); >>>>>>> eee = newfa; } else if ((infer || esc) && s != null && s.name == names._class) { eee = treeutils.makeJavaTypelc(that.selected); <<<<<<< result = eresult = treeutils.makeType(that.pos,that.type); } else if (translatingJML && ( infer || esc) && !localVariables.isEmpty()) { ======= eee = treeutils.makeType(that.pos,that.type); } else if (translatingJML && esc && !localVariables.isEmpty()) { >>>>>>> eee = treeutils.makeType(that.pos,that.type); } else if (translatingJML && (infer || esc) && !localVariables.isEmpty()) {
<<<<<<< protected void initializeBase(LWWindowPeer peer, CPlatformResponder responder) { this.peer = peer; this.responder = responder; } ======= public CGLLayer createCGLayer() { return new CGLLayer(peer); } >>>>>>> public CGLLayer createCGLayer() { return new CGLLayer(peer); } protected void initializeBase(LWWindowPeer peer, CPlatformResponder responder) { this.peer = peer; this.responder = responder; }
<<<<<<< static Object getBean(String name) { return instance.getContainer().getBean(name); } ======= public static void onPause(Context context) { instance.onPause(context); } public static void onResume(Context context) { instance.onResume(context); } >>>>>>> static Object getBean(String name) { return instance.getContainer().getBean(name); } public static void onPause(Context context) { instance.onPause(context); } public static void onResume(Context context) { instance.onResume(context); }
<<<<<<< blockedWindows = new IdentityArrayList<>(); ======= this.resizable = fields.get("resizable", true); this.undecorated = fields.get("undecorated", false); this.title = (String)fields.get("title", ""); this.modalityType = localModalityType; blockedWindows = new IdentityArrayList(); SunToolkit.checkAndSetPolicy(this); initialized = true; >>>>>>> this.resizable = fields.get("resizable", true); this.undecorated = fields.get("undecorated", false); this.title = (String)fields.get("title", ""); this.modalityType = localModalityType; blockedWindows = new IdentityArrayList<>(); SunToolkit.checkAndSetPolicy(this); initialized = true;
<<<<<<< * constructs RedPen with specified config file. ======= * constructs RedPen with specified config file * >>>>>>> * constructs RedPen with specified config file. * <<<<<<< * constructs RedPen with specified config file path. ======= * constructs RedPen with specified config file path * >>>>>>> * constructs RedPen with specified config file path. * <<<<<<< * constructs RedPen with specified configuration. ======= * constructs RedPen with specified configuration * >>>>>>> * constructs RedPen with specified configuration. *
<<<<<<< import cc.redpen.server.RedPenServer; import cc.redpen.validator.ValidationError; ======= >>>>>>> import cc.redpen.validator.ValidationError;
<<<<<<< "plain", server.getDocumentValidatorResource()); Document fileContent = parser.generateDocument(new ======= Parser.Type.PLAIN, server.getDocumentValidatorResource()); FileContent fileContent = parser.generateDocument(new >>>>>>> Parser.Type.PLAIN, server.getDocumentValidatorResource()); Document fileContent = parser.generateDocument(new
<<<<<<< CharacterTable characterTable = resource.getCharacterTable(); this.period = DefaultSymbols.getInstance().get("FULL_STOP").getValue(); ======= // set full stop characters >>>>>>> CharacterTable characterTable = resource.getCharacterTable(); // set full stop characters <<<<<<< this.period = characterTable.getCharacter("FULL_STOP").getValue(); LOG.info("Full stop is set to \"" + this.period + "\""); } else { LOG.warn("FULL_STOP does not exist in the configuration"); LOG.info("Set FULL_STOP as \"" + this.period + "\""); ======= this.periods.add(characterTable.getCharacter("FULL_STOP").getValue()); } else { this.periods.add(DefaultSymbols.get("FULL_STOP").getValue()); } if (characterTable.isContainCharacter("QUESTION_MARK")) { this.periods.add(characterTable.getCharacter("QUESTION_MARK").getValue()); } else { this.periods.add(DefaultSymbols.get("QUESTION_MARK").getValue()); } if (characterTable.isContainCharacter("EXCLAMATION_MARK")) { this.periods.add( characterTable.getCharacter("EXCLAMATION_MARK").getValue()); } else { this.periods.add(DefaultSymbols.get("EXCLAMATION_MARK").getValue()); } for (String period : this.periods) { LOG.info("\"" + period + "\" is added as a end of sentence character"); >>>>>>> this.periods.add(characterTable.getCharacter("FULL_STOP").getValue()); } else { this.periods.add(DefaultSymbols.getInstance().get("FULL_STOP").getValue()); } if (characterTable.isContainCharacter("QUESTION_MARK")) { this.periods.add(characterTable.getCharacter("QUESTION_MARK").getValue()); } else { this.periods.add(DefaultSymbols.getInstance().get("QUESTION_MARK").getValue()); } if (characterTable.isContainCharacter("EXCLAMATION_MARK")) { this.periods.add( characterTable.getCharacter("EXCLAMATION_MARK").getValue()); } else { this.periods.add(DefaultSymbols.getInstance().get("EXCLAMATION_MARK").getValue()); } for (String period : this.periods) { LOG.info("\"" + period + "\" is added as a end of sentence character");
<<<<<<< registerValidator(LongKanjiChainValidator.class); ======= registerValidator(JapaneseAmbiguousNounConjunctionValidator.class); >>>>>>> registerValidator(LongKanjiChainValidator.class); registerValidator(JapaneseAmbiguousNounConjunctionValidator.class);
<<<<<<< /* * Copyright (C) 2012-2018 52°North Initiative for Geospatial Open Source ======= /** * Copyright (C) 2012-2018 52°North Initiative for Geospatial Open Source >>>>>>> /* * Copyright (C) 2012-2018 52°North Initiative for Geospatial Open Source <<<<<<< Criteria c = getSeriesObservationCriteriaFor(request, features, temporalFilterCriterion, null, session); c.createCriteria(DataEntity.PROPERTY_DATASET) .add(Restrictions.not(Restrictions.in(DatasetEntity.PROPERTY_ID, seriesIDs))); c.setProjection(Projections.property(DataEntity.PROPERTY_DATASET)); ======= Criteria c = getScrollableSeriesObservationCriteriaFor(request, features, temporalFilterCriterion, null, session); c.createCriteria(AbstractSeriesObservation.SERIES) .add(Restrictions.not(Restrictions.in(Series.ID, seriesIDs))); c.setProjection(Projections.property(AbstractSeriesObservation.SERIES)); >>>>>>> Criteria c = getScrollableSeriesObservationCriteriaFor(request, features, temporalFilterCriterion, null, session); c.createCriteria(DataEntity.PROPERTY_DATASET) .add(Restrictions.not(Restrictions.in(DatasetEntity.PROPERTY_ID, seriesIDs))); c.setProjection(Projections.property(DataEntity.PROPERTY_DATASET)); <<<<<<< protected Criteria getSeriesObservationCriteriaFor(GetObservationRequest request, Collection<String> features, Criterion filterCriterion, IndeterminateValue sosIndeterminateTime, Session session) throws OwsExceptionReport { final Criteria observationCriteria = getDefaultObservationCriteria(session); ======= protected List<SeriesObservation<?>> getSeriesObservationCriteriaFor(GetObservationRequest request, Collection<String> features, Criterion filterCriterion, SosIndeterminateTime sosIndeterminateTime, Session session) throws OwsExceptionReport { if (request.hasResultFilter()) { List<SeriesObservation<?>> list = new LinkedList<>(); for (SubQueryIdentifier identifier : ResultFilterRestrictions.SubQueryIdentifier.values()) { Criteria c = getDefaultSeriesObservationCriteriaFor(request, features, filterCriterion, sosIndeterminateTime, session); checkAndAddResultFilterCriterion(c, request, identifier, session); list.addAll(c.list()); } return list; } return getDefaultSeriesObservationCriteriaFor(request, features, filterCriterion, sosIndeterminateTime, session).list(); } private Criteria getDefaultSeriesObservationCriteriaFor(GetObservationRequest request, Collection<String> features, Criterion filterCriterion, SosIndeterminateTime sosIndeterminateTime, Session session) throws OwsExceptionReport { final Criteria observationCriteria = getDefaultObservationCriteria(session); Criteria seriesCriteria = observationCriteria.createCriteria(AbstractSeriesObservation.SERIES); checkAndAddSpatialFilteringProfileCriterion(observationCriteria, request, session); addSpecificRestrictions(seriesCriteria, request); if (CollectionHelper.isNotEmpty(request.getProcedures())) { seriesCriteria.createCriteria(Series.PROCEDURE) .add(Restrictions.in(Procedure.IDENTIFIER, request.getProcedures())); } if (CollectionHelper.isNotEmpty(request.getObservedProperties())) { seriesCriteria.createCriteria(Series.OBSERVABLE_PROPERTY) .add(Restrictions.in(ObservableProperty.IDENTIFIER, request.getObservedProperties())); } if (CollectionHelper.isNotEmpty(features)) { seriesCriteria.createCriteria(Series.FEATURE_OF_INTEREST) .add(Restrictions.in(FeatureOfInterest.IDENTIFIER, features)); } if (CollectionHelper.isNotEmpty(request.getOfferings())) { observationCriteria.createCriteria(AbstractSeriesObservation.OFFERINGS) .add(Restrictions.in(Offering.IDENTIFIER, request.getOfferings())); } String logArgs = "request, features, offerings"; if (filterCriterion != null) { logArgs += ", filterCriterion"; observationCriteria.add(filterCriterion); } if (sosIndeterminateTime != null) { logArgs += ", sosIndeterminateTime"; addIndeterminateTimeRestriction(observationCriteria, sosIndeterminateTime); } if (request.isSetFesFilterExtension()) { new ExtensionFesFilterCriteriaAdder(observationCriteria, request.getFesFilterExtensions()).add(); } LOGGER.debug("QUERY getSeriesObservationFor({}): {}", logArgs, HibernateHelper.getSqlString(observationCriteria)); return observationCriteria; } protected Criteria getScrollableSeriesObservationCriteriaFor(GetObservationRequest request, Collection<String> features, Criterion filterCriterion, SosIndeterminateTime sosIndeterminateTime, Session session) throws OwsExceptionReport { final Criteria observationCriteria = getDefaultObservationCriteria(session); >>>>>>> protected List<DataEntity<?>> getSeriesObservationCriteriaFor(GetObservationRequest request, Collection<String> features, Criterion filterCriterion, IndeterminateValue sosIndeterminateTime, Session session) throws OwsExceptionReport { if (request.hasResultFilter()) { List<DataEntity<?>> list = new LinkedList<>(); for (SubQueryIdentifier identifier : ResultFilterRestrictions.SubQueryIdentifier.values()) { Criteria c = getDefaultSeriesObservationCriteriaFor(request, features, filterCriterion, sosIndeterminateTime, session); checkAndAddResultFilterCriterion(c, request, identifier, session); list.addAll(c.list()); } return list; } return getDefaultSeriesObservationCriteriaFor(request, features, filterCriterion, sosIndeterminateTime, session).list(); } private Criteria getDefaultSeriesObservationCriteriaFor(GetObservationRequest request, Collection<String> features, Criterion filterCriterion, SosIndeterminateTime sosIndeterminateTime, Session session) throws OwsExceptionReport { final Criteria observationCriteria = getDefaultObservationCriteria(session); <<<<<<< checkAndAddResultFilterCriterion(observationCriteria, request, session); ======= checkAndAddResultFilterCriterion(observationCriteria, request, null, session); >>>>>>> <<<<<<< protected ScrollableResults getStreamingSeriesObservationsFor(GetObservationRequest request, Collection<String> features, Criterion filterCriterion, IndeterminateValue sosIndeterminateTime, Session session) throws OwsExceptionReport { return getSeriesObservationCriteriaFor(request, features, filterCriterion, sosIndeterminateTime, session).setReadOnly(true).scroll(ScrollMode.FORWARD_ONLY); ======= protected ScrollableResults getStreamingSeriesObservationsFor(GetObservationRequest request, Collection<String> features, Criterion filterCriterion, SosIndeterminateTime sosIndeterminateTime, Session session) throws OwsExceptionReport { return getScrollableSeriesObservationCriteriaFor(request, features, filterCriterion, sosIndeterminateTime, session) .setReadOnly(true).scroll(ScrollMode.FORWARD_ONLY); >>>>>>> protected ScrollableResults getStreamingSeriesObservationsFor(GetObservationRequest request, Collection<String> features, Criterion filterCriterion, SosIndeterminateTime sosIndeterminateTime, Session session) throws OwsExceptionReport { return getScrollableSeriesObservationCriteriaFor(request, features, filterCriterion, sosIndeterminateTime, session) .setReadOnly(true).scroll(ScrollMode.FORWARD_ONLY); <<<<<<< protected Criteria getSeriesObservationCriteriaFor(DatasetEntity series, GetObservationRequest request, IndeterminateValue sosIndeterminateTime, Session session) throws OwsExceptionReport { ======= protected List<SeriesObservation<?>> getSeriesObservationCriteriaFor(Series series, GetObservationRequest request, SosIndeterminateTime sosIndeterminateTime, Session session) throws OwsExceptionReport { if (request.hasResultFilter()) { List<SeriesObservation<?>> list = new LinkedList<>(); for (SubQueryIdentifier identifier : ResultFilterRestrictions.SubQueryIdentifier.values()) { final Criteria c = getDefaultObservationCriteria(session).add( Restrictions.eq(AbstractSeriesObservation.SERIES, series)); checkAndAddSpatialFilteringProfileCriterion(c, request, session); checkAndAddResultFilterCriterion(c, request, identifier, session); if (request.isSetOffering()) { c.createCriteria(AbstractSeriesObservation.OFFERINGS).add( Restrictions.in(Offering.IDENTIFIER, request.getOfferings())); } String logArgs = "request, features, offerings"; logArgs += ", sosIndeterminateTime"; if (series.isSetFirstTimeStamp() && sosIndeterminateTime.equals(SosIndeterminateTime.first)) { addIndeterminateTimeRestriction(c, sosIndeterminateTime, series.getFirstTimeStamp()); } else if (series.isSetLastTimeStamp() && sosIndeterminateTime.equals(SosIndeterminateTime.latest)) { addIndeterminateTimeRestriction(c, sosIndeterminateTime, series.getLastTimeStamp()); } else { addIndeterminateTimeRestriction(c, sosIndeterminateTime); } LOGGER.debug("QUERY getSeriesObservationFor({}) and result filter sub query '{}': {}", logArgs, identifier.name(), HibernateHelper.getSqlString(c)); list.addAll(c.list()); } return list; } >>>>>>> protected List<DataEntity<?>> getSeriesObservationCriteriaFor(Series series, GetObservationRequest request, SosIndeterminateTime sosIndeterminateTime, Session session) throws OwsExceptionReport { if (request.hasResultFilter()) { List<SeriesObservation<?>> list = new LinkedList<>(); for (SubQueryIdentifier identifier : ResultFilterRestrictions.SubQueryIdentifier.values()) { final Criteria c = getDefaultObservationCriteria(session).add( Restrictions.eq(AbstractSeriesObservation.SERIES, series)); checkAndAddSpatialFilteringProfileCriterion(c, request, session); checkAndAddResultFilterCriterion(c, request, identifier, session); if (request.isSetOffering()) { c.createCriteria(AbstractSeriesObservation.OFFERINGS).add( Restrictions.in(Offering.IDENTIFIER, request.getOfferings())); } String logArgs = "request, features, offerings"; logArgs += ", sosIndeterminateTime"; if (series.isSetFirstTimeStamp() && sosIndeterminateTime.equals(SosIndeterminateTime.first)) { addIndeterminateTimeRestriction(c, sosIndeterminateTime, series.getFirstTimeStamp()); } else if (series.isSetLastTimeStamp() && sosIndeterminateTime.equals(SosIndeterminateTime.latest)) { addIndeterminateTimeRestriction(c, sosIndeterminateTime, series.getLastTimeStamp()); } else { addIndeterminateTimeRestriction(c, sosIndeterminateTime); } LOGGER.debug("QUERY getSeriesObservationFor({}) and result filter sub query '{}': {}", logArgs, identifier.name(), HibernateHelper.getSqlString(c)); list.addAll(c.list()); } return list; }
<<<<<<< public GraphTextWriter toString(Trait parent, String path, ABC abc, boolean isStatic, ScriptExportMode exportMode, int scriptIndex, int classIndex, GraphTextWriter writer, List<String> fullyQualifiedNames, boolean parallel) throws InterruptedException { getMetaData(abc, writer); ======= public GraphTextWriter toString(Trait parent, String path, ABC abc, boolean isStatic, ScriptExportMode exportMode, int scriptIndex, int classIndex, GraphTextWriter writer, List<DottedChain> fullyQualifiedNames, boolean parallel) throws InterruptedException { >>>>>>> public GraphTextWriter toString(Trait parent, String path, ABC abc, boolean isStatic, ScriptExportMode exportMode, int scriptIndex, int classIndex, GraphTextWriter writer, List<DottedChain> fullyQualifiedNames, boolean parallel) throws InterruptedException { getMetaData(abc, writer);
<<<<<<< public GraphTextWriter toString(Trait parent, String path, ABC abc, boolean isStatic, ScriptExportMode exportMode, int scriptIndex, int classIndex, GraphTextWriter writer, List<String> fullyQualifiedNames, boolean parallel) throws InterruptedException { getMetaData(abc, writer); ======= public GraphTextWriter toString(Trait parent, String path, ABC abc, boolean isStatic, ScriptExportMode exportMode, int scriptIndex, int classIndex, GraphTextWriter writer, List<DottedChain> fullyQualifiedNames, boolean parallel) throws InterruptedException { >>>>>>> public GraphTextWriter toString(Trait parent, String path, ABC abc, boolean isStatic, ScriptExportMode exportMode, int scriptIndex, int classIndex, GraphTextWriter writer, List<DottedChain> fullyQualifiedNames, boolean parallel) throws InterruptedException { getMetaData(abc, writer);
<<<<<<< public List<Map.Entry<String, Map<String, String>>> metadata; public InterfaceAVM2Item(List<Map.Entry<String, Map<String, String>>> metadata, List<DottedChain> importedClasses, String pkg, List<Integer> openedNamespaces, boolean isFinal, int namespace, String name, List<GraphTargetItem> superInterfaces, List<GraphTargetItem> traits) { ======= public InterfaceAVM2Item(List<DottedChain> importedClasses, DottedChain pkg, List<Integer> openedNamespaces, boolean isFinal, int namespace, String name, List<GraphTargetItem> superInterfaces, List<GraphTargetItem> traits) { >>>>>>> public List<Map.Entry<String, Map<String, String>>> metadata; public InterfaceAVM2Item(List<Map.Entry<String, Map<String, String>>> metadata, List<DottedChain> importedClasses, DottedChain pkg, List<Integer> openedNamespaces, boolean isFinal, int namespace, String name, List<GraphTargetItem> superInterfaces, List<GraphTargetItem> traits) {
<<<<<<< ConstAVM2Item ns = new ConstAVM2Item(metadata, pkg, customAccess, true, namespace, nname, new TypeItem("Namespace"), new StringAVM2Item(null, nval), lexer.yyline()); ======= ConstAVM2Item ns = new ConstAVM2Item(pkg, customAccess, true, namespace, nname, new TypeItem(DottedChain.NAMESPACE), new StringAVM2Item(null, nval), lexer.yyline()); >>>>>>> ConstAVM2Item ns = new ConstAVM2Item(metadata, pkg, customAccess, true, namespace, nname, new TypeItem(DottedChain.NAMESPACE), new StringAVM2Item(null, nval), lexer.yyline()); <<<<<<< private GraphTargetItem classTraits(List<Map.Entry<String, Map<String, String>>> metadata, String scriptName, int gpublicNs, String pkg, List<DottedChain> importedClasses, boolean isDynamic, boolean isFinal, List<Integer> openedNamespaces, String packageName, int namespace, boolean isInterface, String nameStr, GraphTargetItem extendsStr, List<GraphTargetItem> implementsStr, List<AssignableAVM2Item> variables) throws IOException, AVM2ParseException, CompilationException { ======= private GraphTargetItem classTraits(String scriptName, int gpublicNs, DottedChain pkg, List<DottedChain> importedClasses, boolean isDynamic, boolean isFinal, List<Integer> openedNamespaces, DottedChain packageName, int namespace, boolean isInterface, String nameStr, GraphTargetItem extendsStr, List<GraphTargetItem> implementsStr, List<AssignableAVM2Item> variables) throws IOException, AVM2ParseException, CompilationException { >>>>>>> private GraphTargetItem classTraits(List<Map.Entry<String, Map<String, String>>> metadata, String scriptName, int gpublicNs, DottedChain pkg, List<DottedChain> importedClasses, boolean isDynamic, boolean isFinal, List<Integer> openedNamespaces, DottedChain packageName, int namespace, boolean isInterface, String nameStr, GraphTargetItem extendsStr, List<GraphTargetItem> implementsStr, List<AssignableAVM2Item> variables) throws IOException, AVM2ParseException, CompilationException {
<<<<<<< public ClassAVM2Item(List<Map.Entry<String, Map<String, String>>> metadata, List<DottedChain> importedClasses, String pkg, List<Integer> openedNamespaces, int protectedNs, boolean isDynamic, boolean isFinal, int namespace, String className, GraphTargetItem extendsOp, List<GraphTargetItem> implementsOp, List<GraphTargetItem> staticInit, boolean staticInitActivation, List<AssignableAVM2Item> sinitVariables, GraphTargetItem constructor, List<GraphTargetItem> traits) { ======= public ClassAVM2Item(List<DottedChain> importedClasses, DottedChain pkg, List<Integer> openedNamespaces, int protectedNs, boolean isDynamic, boolean isFinal, int namespace, String className, GraphTargetItem extendsOp, List<GraphTargetItem> implementsOp, List<GraphTargetItem> staticInit, boolean staticInitActivation, List<AssignableAVM2Item> sinitVariables, GraphTargetItem constructor, List<GraphTargetItem> traits) { >>>>>>> public ClassAVM2Item(List<Map.Entry<String, Map<String, String>>> metadata, List<DottedChain> importedClasses, DottedChain pkg, List<Integer> openedNamespaces, int protectedNs, boolean isDynamic, boolean isFinal, int namespace, String className, GraphTargetItem extendsOp, List<GraphTargetItem> implementsOp, List<GraphTargetItem> staticInit, boolean staticInitActivation, List<AssignableAVM2Item> sinitVariables, GraphTargetItem constructor, List<GraphTargetItem> traits) {
<<<<<<< ======= import java.io.File; import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; import java.util.Date; import java.util.List; >>>>>>> import java.io.File; import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; import java.util.Date; import java.util.List; <<<<<<< describeJob(job); writeCoveralls(writer, parser); getLog().info(parser.getNumClasses()+" classes covered."); ======= List<Logger> reporters = new ArrayList<Logger>(); reporters.add(new JobLogger(job)); SourceCallback sourceCallback = createSourceCallbackChain(writer, reporters); report(reporters, Position.BEFORE); writeCoveralls(writer, sourceCallback, parser); report(reporters, Position.AFTER); >>>>>>> List<Logger> reporters = new ArrayList<Logger>(); reporters.add(new JobLogger(job)); SourceCallback sourceCallback = createSourceCallbackChain(writer, reporters); report(reporters, Position.BEFORE); writeCoveralls(writer, sourceCallback, parser); report(reporters, Position.AFTER); getLog().info(parser.getNumClasses()+" classes covered."); <<<<<<< Git git = new GitRepository(projectDirectory, branch).load(); return new Job(repoToken, serviceName, serviceJobId, git); ======= Git git = new GitRepository(sourceDirectory, branch).load(); return new Job() .withRepoToken(repoToken) .withServiceName(serviceName) .withServiceJobId(serviceJobId) .withTimestamp(timestamp) .withGit(git); >>>>>>> Git git = new GitRepository(projectDirectory, branch).load(); return new Job() .withRepoToken(repoToken) .withServiceName(serviceName) .withServiceJobId(serviceJobId) .withTimestamp(timestamp) .withGit(git);