conflict_resolution
stringlengths
27
16k
<<<<<<< _reportError("Numeric value (%s) out of range of `long` (%d - %s)", _longIntegerDesc(getText()), Long.MIN_VALUE, Long.MAX_VALUE); ======= reportOverflowLong(getText()); } // @since 2.10 protected void reportOverflowLong(String numDesc) throws IOException { reportOverflowLong(numDesc, JsonToken.VALUE_NUMBER_INT); } // @since 2.10 protected void reportOverflowLong(String numDesc, JsonToken inputType) throws IOException { _reportInputCoercion(String.format("Numeric value (%s) out of range of long (%d - %s)", _longIntegerDesc(numDesc), Long.MIN_VALUE, Long.MAX_VALUE), inputType, Long.TYPE); } /** * @since 2.10 */ protected void _reportInputCoercion(String msg, JsonToken inputType, Class<?> targetType) throws InputCoercionException { throw new InputCoercionException(this, msg, inputType, targetType); >>>>>>> reportOverflowLong(getText()); } // @since 2.10 protected void reportOverflowLong(String numDesc) throws IOException { reportOverflowLong(numDesc, JsonToken.VALUE_NUMBER_INT); } // @since 2.10 protected void reportOverflowLong(String numDesc, JsonToken inputType) throws IOException { _reportInputCoercion(String.format("Numeric value (%s) out of range of `long` (%d - %s)", _longIntegerDesc(numDesc), Long.MIN_VALUE, Long.MAX_VALUE), inputType, Long.TYPE); } protected void _reportInputCoercion(String msg, JsonToken inputType, Class<?> targetType) throws InputCoercionException { throw new InputCoercionException(this, msg, inputType, targetType);
<<<<<<< ======= * * @since 2.10 >>>>>>>
<<<<<<< ======= if (textBuffer == null) { return Arrays.copyOfRange(outputBuffer, 0, outPtr); } textBuffer.setCurrentLength(outPtr); return textBuffer.contentsAsArray(); } /** * Overloaded variant of {@link #quoteAsString(String)}. * * @param input Value {@link CharSequence} to process * * @return JSON-escaped String matching {@code input} * * @since 2.10 */ public char[] quoteAsString(CharSequence input) { // 15-Aug-2019, tatu: Optimize common case as JIT can't get rid of overhead otherwise if (input instanceof String) { return quoteAsString((String) input); } TextBuffer textBuffer = null; char[] outputBuffer = new char[INITIAL_CHAR_BUFFER_SIZE]; final int[] escCodes = CharTypes.get7BitOutputEscapes(); final int escCodeCount = escCodes.length; int inPtr = 0; final int inputLen = input.length(); int outPtr = 0; char[] qbuf = null; outer: while (inPtr < inputLen) { tight_loop: while (true) { char c = input.charAt(inPtr); if (c < escCodeCount && escCodes[c] != 0) { break tight_loop; } if (outPtr >= outputBuffer.length) { if (textBuffer == null) { textBuffer = TextBuffer.fromInitial(outputBuffer); } outputBuffer = textBuffer.finishCurrentSegment(); outPtr = 0; } outputBuffer[outPtr++] = c; if (++inPtr >= inputLen) { break outer; } } // something to escape; 2 or 6-char variant? if (qbuf == null) { qbuf = _qbuf(); } char d = input.charAt(inPtr++); int escCode = escCodes[d]; int length = (escCode < 0) ? _appendNumeric(d, qbuf) : _appendNamed(escCode, qbuf); ; >>>>>>> <<<<<<< ======= * * @param input Value {@link CharSequence} to process * @param output {@link StringBuilder} to append escaped contents to * * @since 2.8 >>>>>>> * * @param input Value {@link CharSequence} to process * @param output {@link StringBuilder} to append escaped contents to <<<<<<< ======= public byte[] encodeAsUTF8(String text) { int inputPtr = 0; int inputEnd = text.length(); int outputPtr = 0; byte[] outputBuffer = new byte[INITIAL_BYTE_BUFFER_SIZE]; int outputEnd = outputBuffer.length; ByteArrayBuilder bb = null; main_loop: while (inputPtr < inputEnd) { int c = text.charAt(inputPtr++); // first tight loop for ascii while (c <= 0x7F) { if (outputPtr >= outputEnd) { if (bb == null) { bb = ByteArrayBuilder.fromInitial(outputBuffer, outputPtr); } outputBuffer = bb.finishCurrentSegment(); outputEnd = outputBuffer.length; outputPtr = 0; } outputBuffer[outputPtr++] = (byte) c; if (inputPtr >= inputEnd) { break main_loop; } c = text.charAt(inputPtr++); } // then multi-byte... if (bb == null) { bb = ByteArrayBuilder.fromInitial(outputBuffer, outputPtr); } if (outputPtr >= outputEnd) { outputBuffer = bb.finishCurrentSegment(); outputEnd = outputBuffer.length; outputPtr = 0; } if (c < 0x800) { // 2-byte outputBuffer[outputPtr++] = (byte) (0xc0 | (c >> 6)); } else { // 3 or 4 bytes // Surrogates? if (c < SURR1_FIRST || c > SURR2_LAST) { // nope outputBuffer[outputPtr++] = (byte) (0xe0 | (c >> 12)); if (outputPtr >= outputEnd) { outputBuffer = bb.finishCurrentSegment(); outputEnd = outputBuffer.length; outputPtr = 0; } outputBuffer[outputPtr++] = (byte) (0x80 | ((c >> 6) & 0x3f)); } else { // yes, surrogate pair if (c > SURR1_LAST) { // must be from first range _illegal(c); } // and if so, followed by another from next range if (inputPtr >= inputEnd) { _illegal(c); } c = _convert(c, text.charAt(inputPtr++)); if (c > 0x10FFFF) { // illegal, as per RFC 4627 _illegal(c); } outputBuffer[outputPtr++] = (byte) (0xf0 | (c >> 18)); if (outputPtr >= outputEnd) { outputBuffer = bb.finishCurrentSegment(); outputEnd = outputBuffer.length; outputPtr = 0; } outputBuffer[outputPtr++] = (byte) (0x80 | ((c >> 12) & 0x3f)); if (outputPtr >= outputEnd) { outputBuffer = bb.finishCurrentSegment(); outputEnd = outputBuffer.length; outputPtr = 0; } outputBuffer[outputPtr++] = (byte) (0x80 | ((c >> 6) & 0x3f)); } } if (outputPtr >= outputEnd) { outputBuffer = bb.finishCurrentSegment(); outputEnd = outputBuffer.length; outputPtr = 0; } outputBuffer[outputPtr++] = (byte) (0x80 | (c & 0x3f)); } if (bb == null) { return Arrays.copyOfRange(outputBuffer, 0, outputPtr); } return bb.completeAndCoalesce(outputPtr); } /** * Overloaded variant of {@link #encodeAsUTF8(String)}. * * @param text Value {@link CharSequence} to process * * @return UTF-8 encoded bytes of {@code text} (without any escaping) * * @since 2.11 */ @SuppressWarnings("resource") >>>>>>>
<<<<<<< private static class StubExecutor implements Executor { private final Handler mHandler = new Handler(Looper.getMainLooper()); @Override public void execute(Runnable command) { mHandler.post(command); } } ======= private void givenThatPackageIsFound() { givenThatPackageNameIsNotNullOrEmpty(); } private void givenThatPackageIsNotFound() { givenThatPackageIsEmpty(); } >>>>>>> private void givenThatPackageIsFound() { givenThatPackageNameIsNotNullOrEmpty(); } private void givenThatPackageIsNotFound() { givenThatPackageIsEmpty(); } private static class StubExecutor implements Executor { private final Handler mHandler = new Handler(Looper.getMainLooper()); @Override public void execute(Runnable command) { mHandler.post(command); } }
<<<<<<< ======= import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.MapperFeature; import com.fasterxml.jackson.databind.ObjectMapper; import nu.studer.java.util.OrderedProperties; >>>>>>> import nu.studer.java.util.OrderedProperties; <<<<<<< import pl.project13.core.util.JsonManager; import pl.project13.core.util.SortedProperties; ======= >>>>>>> import pl.project13.core.util.JsonManager; <<<<<<< ======= import java.util.Comparator; import java.util.HashMap; import java.util.Map; >>>>>>> import java.util.Comparator; <<<<<<< log.info("Writing json file to [{}] (for module {})...", gitPropsFile.getAbsolutePath(), projectName); JsonManager.dumpJson(outputStream, sortedLocalProperties, sourceCharset); ======= try (Writer outputWriter = new OutputStreamWriter(outputStream, sourceCharset)) { log.info("Writing json file to [{}] (for module {})...", gitPropsFile.getAbsolutePath(), projectName); MAPPER.writerWithDefaultPrettyPrinter().writeValue(outputWriter, sortedLocalProperties); } >>>>>>> log.info("Writing json file to [{}] (for module {})...", gitPropsFile.getAbsolutePath(), projectName); JsonManager.dumpJson(outputStream, sortedLocalProperties, sourceCharset); <<<<<<< ======= private Properties readJsonProperties(@Nonnull File jsonFile, Charset sourceCharset) throws CannotReadFileException { final HashMap<String, Object> propertiesMap; try (final FileInputStream fis = new FileInputStream(jsonFile)) { try (final InputStreamReader reader = new InputStreamReader(fis, sourceCharset)) { final TypeReference<HashMap<String, Object>> mapTypeRef = new TypeReference<HashMap<String, Object>>() {}; propertiesMap = MAPPER.readValue(reader, mapTypeRef); } } catch (final Exception ex) { throw new CannotReadFileException(ex); } final Properties retVal = new Properties(); for (final Map.Entry<String, Object> entry : propertiesMap.entrySet()) { retVal.setProperty(entry.getKey(), String.valueOf(entry.getValue())); } return retVal; } >>>>>>>
<<<<<<< Toast toast = Toast.makeText(this, getString(R.string.hockeyapp_paint_indicator_toast), 1000); ======= Toast toast = Toast.makeText(this, Strings.get(Strings.PAINT_INDICATOR_TOAST_ID), Toast.LENGTH_LONG); >>>>>>> Toast toast = Toast.makeText(this, getString(R.string.hockeyapp_paint_indicator_toast), Toast.LENGTH_LONG);
<<<<<<< /** * The URL of the feedback endpoint for this app. */ public static final String EXTRA_URL = "url"; /** * Extra for any initial attachments to add to the feedback message. */ public static final String EXTRA_INITIAL_ATTACHMENTS = "initialAttachments"; /** * Number of attachments allowed per message. **/ private static final int MAX_ATTACHMENTS_PER_MSG = 3; /** * ID of error dialog **/ private static final int DIALOG_ERROR_ID = 0; /** * Activity request constants for ContextMenu and Chooser Intent */ private static final int ATTACH_PICTURE = 1; private static final int ATTACH_FILE = 2; private static final int PAINT_IMAGE = 3; /** * Reference to this **/ private Context mContext; /** * Widgets and layout **/ private TextView mLastUpdatedTextView; private EditText mNameInput; private EditText mEmailInput; private EditText mSubjectInput; private EditText mTextInput; private Button mSendFeedbackButton; private Button mAddAttachmentButton; private Button mAddResponseButton; private Button mRefreshButton; private ScrollView mFeedbackScrollview; private LinearLayout mWrapperLayoutFeedbackAndMessages; private ListView mMessagesListView; /** * Send feedback {@link AsyncTask} */ private SendFeedbackTask mSendFeedbackTask; private Handler mFeedbackHandler; /** * Parse feedback {@link AsyncTask} */ private ParseFeedbackTask mParseFeedbackTask; private Handler mParseFeedbackHandler; /** * Initial attachment uris */ private List<Uri> mInitialAttachments; /** * URL for HockeyApp API **/ private String mUrl; /** * Current error for alert dialog **/ private ErrorObject mError; /** * Message data source **/ private MessagesAdapter mMessagesAdapter; private ArrayList<FeedbackMessage> mFeedbackMessages; /** * True when a message is posted **/ private boolean mInSendFeedback; /** * True when the view was initialized **/ private boolean mFeedbackViewInitialized; /** * Unique token of the message feed **/ private String mToken; /** * Enables/Disables the Send Feedback button. * * @param isEnable the button is enabled if true */ public void enableDisableSendFeedbackButton(boolean isEnable) { if (mSendFeedbackButton != null) { mSendFeedbackButton.setEnabled(isEnable); } ======= /** Number of attachments allowed per message. **/ private static final int MAX_ATTACHMENTS_PER_MSG = 3; /** ID of error dialog **/ private static final int DIALOG_ERROR_ID = 0; /** Activity request constants for ContextMenu and Chooser Intent */ private static final int ATTACH_PICTURE = 1; private static final int ATTACH_FILE = 2; private static final int PAINT_IMAGE = 3; /** Reference to this **/ private Context context; /** Widgets and layout **/ private TextView lastUpdatedTextView; private EditText nameInput; private EditText emailInput; private EditText subjectInput; private EditText textInput; private Button sendFeedbackButton; private Button addAttachmentButton; private Button addResponseButton; private Button refreshButton; private ScrollView feedbackScrollView; private LinearLayout wrapperLayoutFeedbackAndMessages; private ListView messagesListView; /** Send feedback {@link AsyncTask} */ private SendFeedbackTask sendFeedbackTask; private Handler feedbackHandler; /** Parse feedback {@link AsyncTask} */ private ParseFeedbackTask parseFeedbackTask; private Handler parseFeedbackHandler; /** Initial user's name to pre-fill the feedback form with */ private String initialUserName; /** Initial user's e-mail to pre-fill the feedback form with */ private String initialUserEmail; /** Initial attachment uris */ private List<Uri> initialAttachments; /** URL for HockeyApp API **/ private String url; /** Current error for alert dialog **/ private ErrorObject error; /** Message data source **/ private MessagesAdapter messagesAdapter; private ArrayList<FeedbackMessage> feedbackMessages; /** True when a message is posted **/ private boolean inSendFeedback; /** True when the view was initialized **/ private boolean feedbackViewInitialized; /** Unique token of the message feed **/ private String token; /** * Enables/Disables the Send Feedback button. * * @param isEnable the button is enabled if true */ public void enableDisableSendFeedbackButton(boolean isEnable) { if (sendFeedbackButton != null) { sendFeedbackButton.setEnabled(isEnable); } } /** * Called when the Send Feedback {@link Button} is tapped. Sends the feedback and disables * the button to avoid multiple taps. */ @Override public void onClick(View v) { int viewId = v.getId(); if (viewId == R.id.button_send) { sendFeedback(); } else if (viewId == R.id.button_attachment) { ViewGroup attachments = (ViewGroup) findViewById(R.id.wrapper_attachments); if (attachments.getChildCount() >= MAX_ATTACHMENTS_PER_MSG) { //TODO should we add some more text here? Toast.makeText(this, String.valueOf(MAX_ATTACHMENTS_PER_MSG), Toast.LENGTH_SHORT).show(); } else { openContextMenu(v); } } else if (viewId == R.id.button_add_response) { configureFeedbackView(false); inSendFeedback = true; } else if (viewId == R.id.button_refresh) { sendFetchFeedback(url, null, null, null, null, null, PrefsUtil.getInstance().getFeedbackTokenFromPrefs(context), feedbackHandler, true); } } /** * Called when user clicked on context menu item. */ @Override public boolean onContextItemSelected(MenuItem item) { switch (item.getItemId()) { case ATTACH_FILE: case ATTACH_PICTURE: return addAttachment(item.getItemId()); default: return super.onContextItemSelected(item); } } /** * Called when the activity is starting. Sets the title and content view * * @param savedInstanceState Data it most recently supplied in * onSaveInstanceState(Bundle) */ public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_feedback); setTitle(getString(R.string.hockeyapp_feedback_title)); context = this; Bundle extras = getIntent().getExtras(); if (extras != null) { initialUserName = extras.getString("initialUserName"); initialUserEmail = extras.getString("initialUserEmail"); url = extras.getString("url"); Parcelable[] initialAttachmentsArray = extras.getParcelableArray("initialAttachments"); if (initialAttachmentsArray != null) { initialAttachments = new ArrayList<Uri>(); for (Parcelable parcelable : initialAttachmentsArray) { initialAttachments.add((Uri) parcelable); } } >>>>>>> /** * The URL of the feedback endpoint for this app. */ public static final String EXTRA_URL = "url"; /** * Extra for any initial attachments to add to the feedback message. */ public static final String EXTRA_INITIAL_ATTACHMENTS = "initialAttachments"; /** * Number of attachments allowed per message. **/ private static final int MAX_ATTACHMENTS_PER_MSG = 3; /** * ID of error dialog **/ private static final int DIALOG_ERROR_ID = 0; /** * Activity request constants for ContextMenu and Chooser Intent */ private static final int ATTACH_PICTURE = 1; private static final int ATTACH_FILE = 2; private static final int PAINT_IMAGE = 3; /** * Initial user's name to pre-fill the feedback form with */ private String initialUserName; /** * Initial user's e-mail to pre-fill the feedback form with */ private String initialUserEmail; /** * Reference to this **/ private Context mContext; /** * Widgets and layout **/ private TextView mLastUpdatedTextView; private EditText mNameInput; private EditText mEmailInput; private EditText mSubjectInput; private EditText mTextInput; private Button mSendFeedbackButton; private Button mAddAttachmentButton; private Button mAddResponseButton; private Button mRefreshButton; private ScrollView mFeedbackScrollview; private LinearLayout mWrapperLayoutFeedbackAndMessages; private ListView mMessagesListView; /** * Send feedback {@link AsyncTask} */ private SendFeedbackTask mSendFeedbackTask; private Handler mFeedbackHandler; /** * Parse feedback {@link AsyncTask} */ private ParseFeedbackTask mParseFeedbackTask; private Handler mParseFeedbackHandler; /** * Initial attachment uris */ private List<Uri> mInitialAttachments; /** * URL for HockeyApp API **/ private String mUrl; /** * Current error for alert dialog **/ private ErrorObject mError; /** * Message data source **/ private MessagesAdapter mMessagesAdapter; private ArrayList<FeedbackMessage> mFeedbackMessages; /** * True when a message is posted **/ private boolean mInSendFeedback; /** * True when the view was initialized **/ private boolean mFeedbackViewInitialized; /** * Unique token of the message feed **/ private String mToken; /** * Enables/Disables the Send Feedback button. * * @param isEnable the button is enabled if true */ public void enableDisableSendFeedbackButton(boolean isEnable) { if (mSendFeedbackButton != null) { mSendFeedbackButton.setEnabled(isEnable); } <<<<<<< return super.onKeyDown(keyCode, event); } /** * Detaches the activity from the send feedback task and returns the task * as last instance. This way the task is restored when the activity * is immediately re-created. * * @return The download task if present. */ @Override public Object onRetainNonConfigurationInstance() { if (mSendFeedbackTask != null) { mSendFeedbackTask.detach(); ======= else { /** We dont have Name and Email. Check if initial values were provided */ nameInput.setText(initialUserName); emailInput.setText(initialUserEmail); subjectInput.setText(""); if (TextUtils.isEmpty(initialUserName)) { nameInput.requestFocus(); } else if (TextUtils.isEmpty(initialUserEmail)) { emailInput.requestFocus(); } else { subjectInput.requestFocus(); } >>>>>>> return super.onKeyDown(keyCode, event); } /** * Detaches the activity from the send feedback task and returns the task * as last instance. This way the task is restored when the activity * is immediately re-created. * * @return The download task if present. */ @Override public Object onRetainNonConfigurationInstance() { if (mSendFeedbackTask != null) { mSendFeedbackTask.detach(); <<<<<<< }); ======= }); } enableDisableSendFeedbackButton(true); } }; } /** * Load the feedback messages fetched from server * @param feedbackResponse {@link FeedbackResponse} object */ @SuppressLint("SimpleDateFormat") private void loadFeedbackMessages(final FeedbackResponse feedbackResponse) { runOnUiThread(new Runnable() { @Override public void run() { configureFeedbackView(true); SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'"); SimpleDateFormat formatNew = new SimpleDateFormat("d MMM h:mm a"); Date date = null; if (feedbackResponse != null && feedbackResponse.getFeedback() != null && feedbackResponse.getFeedback().getMessages() != null && feedbackResponse. getFeedback().getMessages().size() > 0) { feedbackMessages = feedbackResponse.getFeedback().getMessages(); /** Reverse the order of the feedback messages list, so we show the latest one first */ Collections.reverse(feedbackMessages); /** Set the lastUpdatedTextView text as the date of the latest feedback message */ try { date = format.parse(feedbackMessages.get(0).getCreatedAt()); lastUpdatedTextView.setText(String.format(getString(R.string.hockeyapp_feedback_last_updated_text) + " %s", formatNew.format(date))); } catch (ParseException e1) { e1.printStackTrace(); } if (messagesAdapter == null) { messagesAdapter = new MessagesAdapter(context, feedbackMessages); } else { messagesAdapter.clear(); for (FeedbackMessage message : feedbackMessages) { messagesAdapter.add(message); } messagesAdapter.notifyDataSetChanged(); } messagesListView.setAdapter(messagesAdapter); } } }); } private void resetFeedbackView() { runOnUiThread(new Runnable() { @Override public void run() { PrefsUtil.getInstance().saveFeedbackTokenToPrefs(FeedbackActivity.this, null); getSharedPreferences(ParseFeedbackTask.PREFERENCES_NAME, 0) .edit() .remove(ParseFeedbackTask.ID_LAST_MESSAGE_SEND) .remove(ParseFeedbackTask.ID_LAST_MESSAGE_PROCESSED) .apply(); configureFeedbackView(false); } }); } /** * Send feedback to HockeyApp. */ private void sendFeedback() { if (!Util.isConnectedToNetwork(this)) { Toast errorToast = Toast.makeText(this, R.string.hockeyapp_error_no_network_message, Toast.LENGTH_LONG); errorToast.show(); return; >>>>>>> });
<<<<<<< /** * Default endpoint where all data will be send. */ static final String DEFAULT_ENDPOINT_URL = "https://gate.hockeyapp.net/v2/track"; static final int DEFAULT_SENDER_READ_TIMEOUT = 10 * 1000; static final int DEFAULT_SENDER_CONNECT_TIMEOUT = 15 * 1000; static final int MAX_REQUEST_COUNT = 10; private static final String TAG = "HockeyApp Metrics Sender"; /** * Persistence object used to reserve, free, or delete files. */ protected WeakReference<Persistence> weakPersistence; /** * Thread safe counter to keep track of num of operations */ private AtomicInteger requestCount; /** * Field to hold custom server URL. Will be ignored if null. */ private String customServerURL; /** * Create a Sender instance * Call setPersistence immediately after creating the Sender object */ protected Sender() { this.requestCount = new AtomicInteger(0); } /** * Method that triggers an async task that will check for persisted telemetry and send it to * the server if the number of running requests didn't exceed the maximum number of * running requests as defined in MAX_REQUEST_COUNT. */ protected void triggerSending() { if (requestCount() < MAX_REQUEST_COUNT) { this.requestCount.getAndIncrement(); AsyncTaskUtils.execute( new AsyncTask<Void, Void, Void>() { @Override protected Void doInBackground(Void... params) { // Send the persisted data send(); return null; } } ); } else { HockeyLog.log(TAG, "We have already 10 pending requests, not sending anything."); ======= /** * Default endpoint where all data will be send. */ static final String DEFAULT_ENDPOINT_URL = "https://gate.hockeyapp.net/v2/track"; static final int DEFAULT_SENDER_READ_TIMEOUT = 10 * 1000; static final int DEFAULT_SENDER_CONNECT_TIMEOUT = 15 * 1000; static final int MAX_REQUEST_COUNT = 10; private static final String TAG = "HA-MetricsSender"; /** * Persistence object used to reserve, free, or delete files. */ protected WeakReference<Persistence> weakPersistence; /** * Thread safe counter to keep track of num of operations */ private AtomicInteger requestCount; /** * Field to hold custom server URL. Will be ignored if null. */ private String customServerURL; /** * Create a Sender instance * Call setPersistence immediately after creating the Sender object */ protected Sender() { this.requestCount = new AtomicInteger(0); } /** * Method that triggers an async task that will check for persisted telemetry and send it to * the server if the number of running requests didn't exceed the maximum number of * running requests as defined in MAX_REQUEST_COUNT. */ protected void triggerSending() { if (requestCount() < MAX_REQUEST_COUNT) { this.requestCount.getAndIncrement(); AsyncTaskUtils.execute( new AsyncTask<Void, Void, Void>() { @Override protected Void doInBackground(Void... params) { // Send the persisted data send(); return null; } >>>>>>> /** * Default endpoint where all data will be send. */ static final String DEFAULT_ENDPOINT_URL = "https://gate.hockeyapp.net/v2/track"; static final int DEFAULT_SENDER_READ_TIMEOUT = 10 * 1000; static final int DEFAULT_SENDER_CONNECT_TIMEOUT = 15 * 1000; static final int MAX_REQUEST_COUNT = 10; private static final String TAG = "HA-MetricsSender"; /** * Persistence object used to reserve, free, or delete files. */ protected WeakReference<Persistence> weakPersistence; /** * Thread safe counter to keep track of num of operations */ private AtomicInteger requestCount; /** * Field to hold custom server URL. Will be ignored if null. */ private String customServerURL; /** * Create a Sender instance * Call setPersistence immediately after creating the Sender object */ protected Sender() { this.requestCount = new AtomicInteger(0); } /** * Method that triggers an async task that will check for persisted telemetry and send it to * the server if the number of running requests didn't exceed the maximum number of * running requests as defined in MAX_REQUEST_COUNT. */ protected void triggerSending() { if (requestCount() < MAX_REQUEST_COUNT) { this.requestCount.getAndIncrement(); AsyncTaskUtils.execute( new AsyncTask<Void, Void, Void>() { @Override protected Void doInBackground(Void... params) { // Send the persisted data send(); return null; } } ); } else { HockeyLog.log(TAG, "We have already 10 pending requests, not sending anything.");
<<<<<<< import java.util.ArrayList; import java.util.Date; import java.util.List; import java.util.Locale; import java.util.Map; import java.util.TimeZone; ======= import java.util.*; >>>>>>> import java.util.*; <<<<<<< * Get a SHA-256 hash of the input string if the algorithm is available. If the algorithm is * unavailable, return empty string. * * @param input the string to hash. * @return a SHA-256 hash of the input or the empty string. */ public static String tryHashStringSha256(String input) { String salt = "oRq=MAHHHC~6CCe|JfEqRZ+gc0ESI||g2Jlb^PYjc5UYN2P 27z_+21xxd2n"; try { // Get a Sha256 digest MessageDigest hash = MessageDigest.getInstance("SHA-256"); hash.reset(); hash.update(input.getBytes()); hash.update(salt.getBytes()); byte[] hashedBytes = hash.digest(); char[] hexChars = new char[hashedBytes.length * 2]; for (int j = 0; j < hashedBytes.length; j++) { int v = hashedBytes[j] & 0xFF; hexChars[j * 2] = HEX_ARRAY[v >>> 4]; hexChars[j * 2 + 1] = HEX_ARRAY[v & 0x0F]; } return new String(hexChars); } catch (NoSuchAlgorithmException e) { // All android devices should support SHA256, but if unavailable return "" return ""; } } /** ======= >>>>>>> * Get a SHA-256 hash of the input string if the algorithm is available. If the algorithm is * unavailable, return empty string. * * @param input the string to hash. * @return a SHA-256 hash of the input or the empty string. */ public static String tryHashStringSha256(String input) { String salt = "oRq=MAHHHC~6CCe|JfEqRZ+gc0ESI||g2Jlb^PYjc5UYN2P 27z_+21xxd2n"; try { // Get a Sha256 digest MessageDigest hash = MessageDigest.getInstance("SHA-256"); hash.reset(); hash.update(input.getBytes()); hash.update(salt.getBytes()); byte[] hashedBytes = hash.digest(); char[] hexChars = new char[hashedBytes.length * 2]; for (int j = 0; j < hashedBytes.length; j++) { int v = hashedBytes[j] & 0xFF; hexChars[j * 2] = HEX_ARRAY[v >>> 4]; hexChars[j * 2 + 1] = HEX_ARRAY[v & 0x0F]; } return new String(hexChars); } catch (NoSuchAlgorithmException e) { // All android devices should support SHA256, but if unavailable return "" return ""; } } /**
<<<<<<< String filename = UUID.randomUUID().toString(); ======= try { // Create filename from a random uuid String filename = UUID.randomUUID().toString(); String path = Constants.FILES_PATH + "/" + filename + ".stacktrace"; HockeyLog.debug("Writing unhandled exception to: " + path); // Write the stacktrace to disk writer = new BufferedWriter(new FileWriter(path)); // HockeyApp expects the package name in the first line! writer.write("Package: " + Constants.APP_PACKAGE + "\n"); writer.write("Version Code: " + Constants.APP_VERSION + "\n"); writer.write("Version Name: " + Constants.APP_VERSION_NAME + "\n"); if ((listener == null) || (listener.includeDeviceData())) { writer.write("Android: " + Constants.ANDROID_VERSION + "\n"); writer.write("Manufacturer: " + Constants.PHONE_MANUFACTURER + "\n"); writer.write("Model: " + Constants.PHONE_MODEL + "\n"); } >>>>>>> String filename = UUID.randomUUID().toString(); <<<<<<< ======= } } catch (IOException another) { HockeyLog.error("Error saving exception stacktrace!\n", another); } finally { try { if (writer != null) { writer.close(); } >>>>>>> <<<<<<< HockeyLog.error(Constants.TAG, "Error saving crash meta data!", e); ======= HockeyLog.error("Error saving exception stacktrace!\n", e); e.printStackTrace(); >>>>>>> HockeyLog.error("Error saving crash meta data!", e);
<<<<<<< super.setUp(); injectInstrumentation(InstrumentationRegistry.getInstrumentation()); //noinspection SpellCheckingInspection sut = new PublicTelemetryContext(getInstrumentation().getContext(), ======= sut = new PublicTelemetryContext(InstrumentationRegistry.getContext(), >>>>>>> //noinspection SpellCheckingInspection sut = new PublicTelemetryContext(InstrumentationRegistry.getContext(), <<<<<<< Assert.assertNotNull(sut); Assert.assertNotNull(sut.getInstrumentationKey()); Assert.assertNotNull(sut.mDevice); Assert.assertNotNull(sut.mUser); Assert.assertNotNull(sut.mInternal); Assert.assertNotNull(sut.mApplication); ======= assertNotNull(sut); assertNotNull(sut.getInstrumentationKey()); assertNotNull(sut.mContext); assertNotNull(sut.mDevice); assertNotNull(sut.mUser); assertNotNull(sut.mInternal); assertNotNull(sut.mApplication); >>>>>>> assertNotNull(sut); assertNotNull(sut.getInstrumentationKey()); assertNotNull(sut.mDevice); assertNotNull(sut.mUser); assertNotNull(sut.mInternal); assertNotNull(sut.mApplication);
<<<<<<< public class DownloadFileTask extends AsyncTask<String, Integer, Boolean>{ private Context context; private DownloadFileListener notifier; private String urlString; private String filename; private String filePath; private ProgressDialog progressDialog; private String downloadErrorMessage; ======= public class DownloadFileTask extends AsyncTask<Void, Integer, Long> { protected static final int MAX_REDIRECTS = 6; protected Context context; protected DownloadFileListener notifier; protected String urlString; protected String filename; protected String filePath; protected ProgressDialog progressDialog; >>>>>>> public class DownloadFileTask extends AsyncTask<Void, Integer, Long> { protected static final int MAX_REDIRECTS = 6; protected Context context; protected DownloadFileListener notifier; protected String urlString; protected String filename; protected String filePath; protected ProgressDialog progressDialog; private String downloadErrorMessage; <<<<<<< publishProgress((int)(total * 100 / lengthOfFile)); ======= publishProgress(Math.round(total * 100.0f / lenghtOfFile)); >>>>>>> publishProgress(Math.round(total * 100.0f / lengthOfFile)); <<<<<<< return (total > 0); } ======= return total; } >>>>>>> return total; }
<<<<<<< import android.text.TextUtils; import android.util.Log; ======= >>>>>>> import android.text.TextUtils; import android.util.Log; <<<<<<< if (instance == null || !isUserMetricsEnabled()) { Log.w(TAG, "MetricsManager hasn't been registered or User Metrics has been disabled. No User Metrics will be collected!"); ======= if (instance == null) { HockeyLog.warn(TAG, "MetricsManager hasn't been registered. No Metrics will be collected!"); >>>>>>> if (instance == null || !isUserMetricsEnabled()) { HockeyLog.warn(TAG, "MetricsManager hasn't been registered or User Metrics has been disabled. No User Metrics will be collected!"); <<<<<<< @TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH) private void registerTelemetryLifecycleCallbacks() { if (mTelemetryLifecycleCallbacks == null) { mTelemetryLifecycleCallbacks = new TelemetryLifecycleCallbacks(); } getApplication().registerActivityLifecycleCallbacks(mTelemetryLifecycleCallbacks); } @TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH) private void unregisterTelemetryLifecycleCallbacks() { if (mTelemetryLifecycleCallbacks == null) { return; } getApplication().unregisterActivityLifecycleCallbacks(mTelemetryLifecycleCallbacks); mTelemetryLifecycleCallbacks = null; } ======= >>>>>>> @TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH) private void registerTelemetryLifecycleCallbacks() { if (mTelemetryLifecycleCallbacks == null) { mTelemetryLifecycleCallbacks = new TelemetryLifecycleCallbacks(); } getApplication().registerActivityLifecycleCallbacks(mTelemetryLifecycleCallbacks); } @TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH) private void unregisterTelemetryLifecycleCallbacks() { if (mTelemetryLifecycleCallbacks == null) { return; } getApplication().unregisterActivityLifecycleCallbacks(mTelemetryLifecycleCallbacks); mTelemetryLifecycleCallbacks = null; }
<<<<<<< supportedLocales.add(czech); Comparator comparator = (Object o1, Object o2) -> o1.toString().compareTo(o2.toString()); ======= supportedLocales.add(ukrainian); >>>>>>> supportedLocales.add(ukrainian); supportedLocales.add(czech); Comparator comparator = (Object o1, Object o2) -> o1.toString().compareTo(o2.toString()); <<<<<<< settingsLabelKey.put(czech, "settings_language_cs"); Collections.sort(supportedLocales,(o1, o2) -> o1.toString().compareTo(o2.toString())); ======= settingsLabelKey.put(ukrainian, "settings_language_uk"); >>>>>>> settingsLabelKey.put(ukrainian, "settings_language_uk"); settingsLabelKey.put(czech, "settings_language_cs"); Collections.sort(supportedLocales,(o1, o2) -> o1.toString().compareTo(o2.toString()));
<<<<<<< @Override public void verify() throws MappingException { super.verify(); CassandraPersistentEntityMetadataVerifier verifier = new DefaultCassandraPersistentEntityMetadataVerifier(); verifier.verify(this); } ======= @Override public CassandraMappingContext getMappingContext() { return mappingContext; } @Override public boolean isCompositePrimaryKey() { return getType().isAnnotationPresent(PrimaryKeyClass.class); } @Override public List<CassandraPersistentProperty> getCompositePrimaryKeyProperties() { final List<CassandraPersistentProperty> properties = new ArrayList<CassandraPersistentProperty>(); if (!isCompositePrimaryKey()) { throw new IllegalStateException(String.format("[%s] does not represent a composite primary key class", this .getType().getName())); } addCompositePrimaryKeyProperties(this, properties); return properties; } protected void addCompositePrimaryKeyProperties(CassandraPersistentEntity<?> compositePrimaryKeyEntity, final List<CassandraPersistentProperty> properties) { compositePrimaryKeyEntity.doWithProperties(new PropertyHandler<CassandraPersistentProperty>() { @Override public void doWithPersistentProperty(CassandraPersistentProperty p) { if (p.isCompositePrimaryKey()) { addCompositePrimaryKeyProperties(p.getCompositePrimaryKeyEntity(), properties); } else { properties.add(p); } } }); } >>>>>>> @Override public CassandraMappingContext getMappingContext() { return mappingContext; } @Override public boolean isCompositePrimaryKey() { return getType().isAnnotationPresent(PrimaryKeyClass.class); } @Override public List<CassandraPersistentProperty> getCompositePrimaryKeyProperties() { final List<CassandraPersistentProperty> properties = new ArrayList<CassandraPersistentProperty>(); if (!isCompositePrimaryKey()) { throw new IllegalStateException(String.format("[%s] does not represent a composite primary key class", this .getType().getName())); } addCompositePrimaryKeyProperties(this, properties); return properties; } protected void addCompositePrimaryKeyProperties(CassandraPersistentEntity<?> compositePrimaryKeyEntity, final List<CassandraPersistentProperty> properties) { compositePrimaryKeyEntity.doWithProperties(new PropertyHandler<CassandraPersistentProperty>() { @Override public void doWithPersistentProperty(CassandraPersistentProperty p) { if (p.isCompositePrimaryKey()) { addCompositePrimaryKeyProperties(p.getCompositePrimaryKeyEntity(), properties); } else { properties.add(p); } } }); } @Override public void verify() throws MappingException { super.verify(); CassandraPersistentEntityMetadataVerifier verifier = new DefaultCassandraPersistentEntityMetadataVerifier(); verifier.verify(this); }
<<<<<<< /* * Copyright 2013-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.springframework.cassandra.test.unit.core.cql; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import static org.springframework.cassandra.core.CqlIdentifier.isQuotedIdentifier; import static org.springframework.cassandra.core.CqlIdentifier.isUnquotedIdentifier; import org.junit.Test; public class CqlIdentifierTest { @Test public void testIsQuotedIdentifier() throws Exception { assertFalse(isQuotedIdentifier("my\"id")); assertTrue(isQuotedIdentifier("my\"\"id")); assertFalse(isUnquotedIdentifier("my\"id")); assertTrue(isUnquotedIdentifier("myid")); } } ======= package org.springframework.cassandra.test.unit.core.cql; import static org.junit.Assert.*; import static org.springframework.cassandra.core.cql.CqlIdentifier.cqlId; import static org.springframework.cassandra.core.cql.CqlIdentifier.quotedCqlId; import org.junit.Test; import org.springframework.cassandra.core.ReservedKeyword; import org.springframework.cassandra.core.cql.CqlIdentifier; public class CqlIdentifierTest { @Test public void testUnquotedIdentifiers() { String[] ids = new String[] { "foo", "Foo", "FOO", "a_", "a1" }; for (String id : ids) { CqlIdentifier cqlId = cqlId(id); assertFalse(cqlId.isQuoted()); assertEquals(id.toLowerCase(), cqlId.toCql()); } } @Test public void testForceQuotedIdentifiers() { String[] ids = new String[] { "foo", "Foo", "FOO", "a_", "a1" }; for (String id : ids) { CqlIdentifier cqlId = quotedCqlId(id); assertTrue(cqlId.isQuoted()); assertEquals("\"" + id + "\"", cqlId.toCql()); } } @Test public void testReservedWordsEndUpQuoted() { for (ReservedKeyword id : ReservedKeyword.values()) { CqlIdentifier cqlId = cqlId(id.name()); assertTrue(cqlId.isQuoted()); assertEquals("\"" + id.name() + "\"", cqlId.toCql()); cqlId = cqlId(id.name().toLowerCase()); assertTrue(cqlId.isQuoted()); assertEquals("\"" + id.name().toLowerCase() + "\"", cqlId.toCql()); } } @Test public void testIllegals() { String[] illegals = new String[] { null, "", "a ", "a a", "a\"", "a'", "a''", "\"\"", "''", "-", "a-", "_", "_a" }; for (String illegal : illegals) { try { cqlId(illegal); fail(String.format("identifier [%s] should have caused IllegalArgumentException", illegal)); } catch (IllegalArgumentException x) { // :) } } } } >>>>>>> /* * Copyright 2013-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.springframework.cassandra.test.unit.core.cql; import static org.junit.Assert.*; import static org.springframework.cassandra.core.cql.CqlIdentifier.cqlId; import static org.springframework.cassandra.core.cql.CqlIdentifier.quotedCqlId; import org.junit.Test; import org.springframework.cassandra.core.ReservedKeyword; import org.springframework.cassandra.core.cql.CqlIdentifier; public class CqlIdentifierTest { @Test public void testUnquotedIdentifiers() { String[] ids = new String[] { "foo", "Foo", "FOO", "a_", "a1" }; for (String id : ids) { CqlIdentifier cqlId = cqlId(id); assertFalse(cqlId.isQuoted()); assertEquals(id.toLowerCase(), cqlId.toCql()); } } @Test public void testForceQuotedIdentifiers() { String[] ids = new String[] { "foo", "Foo", "FOO", "a_", "a1" }; for (String id : ids) { CqlIdentifier cqlId = quotedCqlId(id); assertTrue(cqlId.isQuoted()); assertEquals("\"" + id + "\"", cqlId.toCql()); } } @Test public void testReservedWordsEndUpQuoted() { for (ReservedKeyword id : ReservedKeyword.values()) { CqlIdentifier cqlId = cqlId(id.name()); assertTrue(cqlId.isQuoted()); assertEquals("\"" + id.name() + "\"", cqlId.toCql()); cqlId = cqlId(id.name().toLowerCase()); assertTrue(cqlId.isQuoted()); assertEquals("\"" + id.name().toLowerCase() + "\"", cqlId.toCql()); } } @Test public void testIllegals() { String[] illegals = new String[] { null, "", "a ", "a a", "a\"", "a'", "a''", "\"\"", "''", "-", "a-", "_", "_a" }; for (String illegal : illegals) { try { cqlId(illegal); fail(String.format("identifier [%s] should have caused IllegalArgumentException", illegal)); } catch (IllegalArgumentException x) { // :) } } } }
<<<<<<< ======= import android.text.util.Linkify; >>>>>>> import android.text.util.Linkify; <<<<<<< ======= HashSet<HNComment> mUpvotedComments; >>>>>>> HashSet<HNComment> mUpvotedComments;
<<<<<<< int argParamCount = mainFunction.getParameterTypes().length; ======= >>>>>>> <<<<<<< int argsCount = mainArgs.length + 1; if (argParamCount == 0) { globalFunction = factoryFacade.createGlobalRootNode(staticInits, mainCallTarget, deallocations); } else { if (argParamCount == 1) { globalFunction = factoryFacade.createGlobalRootNode(staticInits, mainCallTarget, deallocations, argsCount); } else { Object[] args = new Object[argsCount]; args[0] = sourceFile; System.arraycopy(mainArgs, 0, args, 1, mainArgs.length); LLVMParserAsserts.assertNoNullElement(args); LLVMAddress allocatedArgsStartAddress = getArgsAsStringArray(args); // Checkstyle: stop magic number check if (argParamCount == 2) { globalFunction = factoryFacade.createGlobalRootNode(staticInits, mainCallTarget, deallocations, argsCount, allocatedArgsStartAddress); } else if (argParamCount == 3) { LLVMAddress posixEnvPointer = LLVMAddress.NULL_POINTER; globalFunction = factoryFacade.createGlobalRootNode(staticInits, mainCallTarget, deallocations, argsCount, allocatedArgsStartAddress, posixEnvPointer); } else { throw new AssertionError(argParamCount); } // Checkstyle: resume magic number check } } RootCallTarget globalFunctionRoot = Truffle.getRuntime().createCallTarget(globalFunction); RootNode globalRootNode = factoryFacade.createGlobalRootNodeWrapping(globalFunctionRoot, mainFunction.getReturnType()); RootCallTarget wrappedCallTarget = Truffle.getRuntime().createCallTarget(globalRootNode); ======= globalFunction = factoryFacade.createGlobalRootNode(staticInits, mainCallTarget, deallocations, mainArgs, sourceFile, mainFunction.getLlvmParamTypes()); RootCallTarget wrappedCallTarget = Truffle.getRuntime().createCallTarget(wrapMainFunction(Truffle.getRuntime().createCallTarget(globalFunction))); >>>>>>> globalFunction = factoryFacade.createGlobalRootNode(staticInits, mainCallTarget, deallocations, mainArgs, sourceFile, mainFunction.getParameterTypes()); RootCallTarget globalFunctionRoot = Truffle.getRuntime().createCallTarget(globalFunction); RootNode globalRootNode = factoryFacade.createGlobalRootNodeWrapping(globalFunctionRoot, mainFunction.getReturnType()); RootCallTarget wrappedCallTarget = Truffle.getRuntime().createCallTarget(globalRootNode); <<<<<<< private static LLVMAddress getArgsAsStringArray(Object... args) { LLVMParserAsserts.assertNoNullElement(args); String[] stringArgs = getStringArgs(args); int argsMemory = stringArgs.length * LLVMAddress.WORD_LENGTH_BIT / Byte.SIZE; LLVMAddress allocatedArgsStartAddress = LLVMHeap.allocateMemory(argsMemory); LLVMAddress allocatedArgs = allocatedArgsStartAddress; for (int i = 0; i < stringArgs.length; i++) { String string = stringArgs[i]; LLVMAddress allocatedCString = LLVMHeap.allocateCString(string); LLVMMemory.putAddress(allocatedArgs, allocatedCString); allocatedArgs = allocatedArgs.increment(LLVMAddress.WORD_LENGTH_BIT / Byte.SIZE); } return allocatedArgsStartAddress; } private static String[] getStringArgs(Object... args) { LLVMParserAsserts.assertNoNullElement(args); String[] stringArgs = new String[args.length]; for (int i = 0; i < args.length; i++) { stringArgs[i] = args[i].toString(); } LLVMParserAsserts.assertNoNullElement(stringArgs); return stringArgs; } public Map<LLVMFunctionDescriptor, RootCallTarget> visit(Model model, NodeFactoryFacade facade) { ======= private RootNode wrapMainFunction(RootCallTarget mainCallTarget) { LLVMFunction mainSignature = LLVMFunction.createFromName("@main"); LLVMRuntimeType returnType = mainSignature.getLlvmReturnType(); return factoryFacade.createGlobalRootNodeWrapping(mainCallTarget, returnType); } public Map<LLVMFunction, RootCallTarget> visit(Model model, NodeFactoryFacade facade) { >>>>>>> public Map<LLVMFunctionDescriptor, RootCallTarget> visit(Model model, NodeFactoryFacade facade) {
<<<<<<< interface Call { ======= public interface Call extends Instruction { >>>>>>> public interface Call {
<<<<<<< private EditorState editorState; public OutlineService(String outlineRule, boolean source, int expandToLevel, EditorState editorState) { ======= public OutlineService(String outlineRule, int expandToLevel) { >>>>>>> public OutlineService(String outlineRule, boolean source, int expandToLevel, EditorState editorState) { <<<<<<< public IStrategoTerm getOutline() { ======= public void setOutlineRule(String rule) { this.outlineRule = rule; } @Override public void setExpandToLevel(int level) { this.expandToLevel = level; } @Override public IStrategoTerm getOutline(EditorState editorState) { >>>>>>> public IStrategoTerm getOutline(EditorState editorState) {
<<<<<<< protected @Nullable JSGLRVersion jsglrVersion; ======= protected @Nullable Sdf2tableVersion sdf2tableVersion; >>>>>>> protected @Nullable Sdf2tableVersion sdf2tableVersion; protected @Nullable JSGLRVersion jsglrVersion; <<<<<<< name, sdfEnabled, parseTable, completionsParseTable, jsglrVersion, langContribs, generates, exports); ======= name, sdfEnabled, sdf2tableVersion, parseTable, completionsParseTable, langContribs, generates, exports); >>>>>>> name, sdfEnabled, parseTable, completionsParseTable, sdf2tableVersion, jsglrVersion, langContribs, generates, exports); <<<<<<< jsglrVersion = null; ======= sdf2tableVersion = null; >>>>>>> sdf2tableVersion = null; jsglrVersion = null; <<<<<<< withJSGLRVersion(config.jsglrVersion()); ======= withSdf2tableVersion(config.sdf2tableVersion()); >>>>>>> withSdf2tableVersion(config.sdf2tableVersion()); withJSGLRVersion(config.jsglrVersion()); <<<<<<< @Override public ILanguageComponentConfigBuilder withJSGLRVersion(JSGLRVersion jsglrVersion) { this.jsglrVersion = jsglrVersion; return this; } ======= @Override public ILanguageComponentConfigBuilder withSdf2tableVersion(Sdf2tableVersion sdf2tableVersion) { this.sdf2tableVersion = sdf2tableVersion; return this; } >>>>>>> @Override public ILanguageComponentConfigBuilder withSdf2tableVersion(Sdf2tableVersion sdf2tableVersion) { this.sdf2tableVersion = sdf2tableVersion; return this; } @Override public ILanguageComponentConfigBuilder withJSGLRVersion(JSGLRVersion jsglrVersion) { this.jsglrVersion = jsglrVersion; return this; }
<<<<<<< protected Level debugLevel(C context) { return context.debug() ? Level.Info : Level.Debug; } ======= protected Function<ITerm, String> prettyprint(C context, @Nullable String resource) { return term -> { final ITerm simpleTerm = TermSimplifier.focus(resource, term); final IStrategoTerm sterm = strategoTerms.toStratego(simpleTerm); String text; try { text = Optional.ofNullable(strategoCommon.invoke(context.language(), context, sterm, PP_STRATEGY)) .map(Tools::asJavaString).orElseGet(() -> simpleTerm.toString()); } catch(MetaborgException ex) { logger.warn("Pretty-printing failed on {}, using simple term representation.", ex, simpleTerm); text = simpleTerm.toString(); } return text; }; } protected Level debugLevel(C context) { return context.debug() ? Level.Info : Level.Debug; } >>>>>>> protected Level debugLevel(C context) { return context.debug() ? Level.Info : Level.Debug; } protected Function<ITerm, String> prettyprint(C context, @Nullable String resource) { return term -> { final ITerm simpleTerm = TermSimplifier.focus(resource, term); final IStrategoTerm sterm = strategoTerms.toStratego(simpleTerm); String text; try { text = Optional.ofNullable(strategoCommon.invoke(context.language(), context, sterm, PP_STRATEGY)) .map(Tools::asJavaString).orElseGet(() -> simpleTerm.toString()); } catch(MetaborgException ex) { logger.warn("Pretty-printing failed on {}, using simple term representation.", ex, simpleTerm); text = simpleTerm.toString(); } return text; }; }
<<<<<<< name, langContribs, generates, exports, pardonedLanguages, useBuildSystemSpec, sdfVersion, sdfEnabled, sdfMainFile, parseTable, jsglrVersion, completionsParseTable, sdf2tableVersion, placeholderCharacters, prettyPrint, ======= name, langContribs, generates, exports, pardonedLanguages, useBuildSystemSpec, sdfVersion, sdfEnabled, sdf2tableVersion, sdfMainFile, parseTable, completionsParseTable, placeholderCharacters, prettyPrint, >>>>>>> name, langContribs, generates, exports, pardonedLanguages, useBuildSystemSpec, sdfVersion, sdfEnabled, sdf2tableVersion, sdfMainFile, parseTable, jsglrVersion, completionsParseTable, placeholderCharacters, prettyPrint,
<<<<<<< final ITokens tokenizer = rootImploderAttachment.getLeftToken().getTokenizer(); ======= if(rootImploderAttachment == null) { logger.error("Cannot categorize input {} of {}, it does not have an imploder attachment", parseResult, language); // GTODO: throw exception instead return regionCategories; } final ITokenizer tokenizer = rootImploderAttachment.getLeftToken().getTokenizer(); if(tokenizer == null) { logger.error("Cannot categorize input {} of {}, it does not have a tokenizer", parseResult, language); // GTODO: throw exception instead return regionCategories; } >>>>>>> if(rootImploderAttachment == null) { logger.error("Cannot categorize input {} of {}, it does not have an imploder attachment", parseResult, language); // GTODO: throw exception instead return regionCategories; } final ITokens tokenizer = rootImploderAttachment.getLeftToken().getTokenizer(); if(tokenizer == null) { logger.error("Cannot categorize input {} of {}, it does not have a tokenizer", parseResult, language); // GTODO: throw exception instead return regionCategories; }
<<<<<<< import mb.pie.taskdefs.guice.GuiceTaskDefs; import mb.stratego.build.StrIncr; import java.io.File; import java.io.IOException; import java.io.ObjectInputStream; import java.io.Serializable; import java.net.URI; import javax.annotation.Nullable; ======= import com.google.inject.Injector; >>>>>>> import mb.pie.taskdefs.guice.GuiceTaskDefs; import mb.stratego.build.StrIncr; import com.google.inject.Injector; <<<<<<< private static Injector injector; private static IResourceService resourceService; private static ILanguageService languageService; private static ILanguageIdentifierService languageIdentifierService; private static ILanguagePathService languagePathService; private static IProjectService projectService; private static ISpoofaxLanguageSpecService languageSpecService; private static ISourceTextService sourceTextService; private static ISpoofaxUnitService unitService; private static ISpoofaxSyntaxService syntaxService; private static ITermFactoryService termFactoryService; private static IStrategoCommon strategoCommon; private static ISpoofaxTransformService transformService; private static IContextService contextService; private static IDialectService dialectService; private static GuiceTaskDefs taskDefs; private static StrIncr strIncr; ======= private static final ThreadLocal<Injector> injector = new ThreadLocal<>(); private static final ThreadLocal<IResourceService> resourceService = new ThreadLocal<>(); private static final ThreadLocal<ILanguageService> languageService = new ThreadLocal<>(); private static final ThreadLocal<ILanguageIdentifierService> languageIdentifierService = new ThreadLocal<>(); private static final ThreadLocal<ILanguagePathService> languagePathService = new ThreadLocal<>(); private static final ThreadLocal<IProjectService> projectService = new ThreadLocal<>(); private static final ThreadLocal<ISpoofaxLanguageSpecService> languageSpecService = new ThreadLocal<>(); private static final ThreadLocal<ISourceTextService> sourceTextService = new ThreadLocal<>(); private static final ThreadLocal<ISpoofaxUnitService> unitService = new ThreadLocal<>(); private static final ThreadLocal<ISpoofaxSyntaxService> syntaxService = new ThreadLocal<>(); private static final ThreadLocal<ITermFactoryService> termFactoryService = new ThreadLocal<>(); private static final ThreadLocal<IStrategoCommon> strategoCommon = new ThreadLocal<>(); private static final ThreadLocal<ISpoofaxTransformService> transformService = new ThreadLocal<>(); private static final ThreadLocal<IContextService> contextService = new ThreadLocal<>(); private static final ThreadLocal<IDialectService> dialectService = new ThreadLocal<>(); >>>>>>> private static final ThreadLocal<Injector> injector = new ThreadLocal<>(); private static final ThreadLocal<IResourceService> resourceService = new ThreadLocal<>(); private static final ThreadLocal<ILanguageService> languageService = new ThreadLocal<>(); private static final ThreadLocal<ILanguageIdentifierService> languageIdentifierService = new ThreadLocal<>(); private static final ThreadLocal<ILanguagePathService> languagePathService = new ThreadLocal<>(); private static final ThreadLocal<IProjectService> projectService = new ThreadLocal<>(); private static final ThreadLocal<ISpoofaxLanguageSpecService> languageSpecService = new ThreadLocal<>(); private static final ThreadLocal<ISourceTextService> sourceTextService = new ThreadLocal<>(); private static final ThreadLocal<ISpoofaxUnitService> unitService = new ThreadLocal<>(); private static final ThreadLocal<ISpoofaxSyntaxService> syntaxService = new ThreadLocal<>(); private static final ThreadLocal<ITermFactoryService> termFactoryService = new ThreadLocal<>(); private static final ThreadLocal<IStrategoCommon> strategoCommon = new ThreadLocal<>(); private static final ThreadLocal<ISpoofaxTransformService> transformService = new ThreadLocal<>(); private static final ThreadLocal<IContextService> contextService = new ThreadLocal<>(); private static final ThreadLocal<IDialectService> dialectService = new ThreadLocal<>(); private static final ThreadLocal<GuiceTaskDefs> taskDefs = new ThreadLocal<>(); private static final ThreadLocal<StrIncr> strIncr = new ThreadLocal<>(); <<<<<<< injector = newInjector; resourceService = newInjector.getInstance(IResourceService.class); languageService = newInjector.getInstance(ILanguageService.class); languageIdentifierService = newInjector.getInstance(ILanguageIdentifierService.class); languagePathService = newInjector.getInstance(ILanguagePathService.class); projectService = newInjector.getInstance(IProjectService.class); languageSpecService = newInjector.getInstance(ISpoofaxLanguageSpecService.class); sourceTextService = newInjector.getInstance(ISourceTextService.class); unitService = newInjector.getInstance(ISpoofaxUnitService.class); syntaxService = newInjector.getInstance(ISpoofaxSyntaxService.class); termFactoryService = newInjector.getInstance(ITermFactoryService.class); strategoCommon = newInjector.getInstance(IStrategoCommon.class); transformService = newInjector.getInstance(ISpoofaxTransformService.class); contextService = newInjector.getInstance(IContextService.class); dialectService = newInjector.getInstance(IDialectService.class); taskDefs = newInjector.getInstance(GuiceTaskDefs.class); strIncr = newInjector.getInstance(StrIncr.class); ======= injector.set(newInjector); resourceService.set(newInjector.getInstance(IResourceService.class)); languageService.set(newInjector.getInstance(ILanguageService.class)); languageIdentifierService.set(newInjector.getInstance(ILanguageIdentifierService.class)); languagePathService.set(newInjector.getInstance(ILanguagePathService.class)); projectService.set(newInjector.getInstance(IProjectService.class)); languageSpecService.set(newInjector.getInstance(ISpoofaxLanguageSpecService.class)); sourceTextService.set(newInjector.getInstance(ISourceTextService.class)); unitService.set(newInjector.getInstance(ISpoofaxUnitService.class)); syntaxService.set(newInjector.getInstance(ISpoofaxSyntaxService.class)); termFactoryService.set(newInjector.getInstance(ITermFactoryService.class)); strategoCommon.set(newInjector.getInstance(IStrategoCommon.class)); transformService.set(newInjector.getInstance(ISpoofaxTransformService.class)); contextService.set(newInjector.getInstance(IContextService.class)); dialectService.set(newInjector.getInstance(IDialectService.class)); >>>>>>> injector.set(newInjector); resourceService.set(newInjector.getInstance(IResourceService.class)); languageService.set(newInjector.getInstance(ILanguageService.class)); languageIdentifierService.set(newInjector.getInstance(ILanguageIdentifierService.class)); languagePathService.set(newInjector.getInstance(ILanguagePathService.class)); projectService.set(newInjector.getInstance(IProjectService.class)); languageSpecService.set(newInjector.getInstance(ISpoofaxLanguageSpecService.class)); sourceTextService.set(newInjector.getInstance(ISourceTextService.class)); unitService.set(newInjector.getInstance(ISpoofaxUnitService.class)); syntaxService.set(newInjector.getInstance(ISpoofaxSyntaxService.class)); termFactoryService.set(newInjector.getInstance(ITermFactoryService.class)); strategoCommon.set(newInjector.getInstance(IStrategoCommon.class)); transformService.set(newInjector.getInstance(ISpoofaxTransformService.class)); contextService.set(newInjector.getInstance(IContextService.class)); dialectService.set(newInjector.getInstance(IDialectService.class)); taskDefs.set(newInjector.getInstance(GuiceTaskDefs.class)); strIncr.set(newInjector.getInstance(StrIncr.class));
<<<<<<< endOffset=getRightToken(node).getEndOffset()+1; int lookForward=endOffset-1; ======= endOffset=node.getRightIToken().getEndOffset(); int lookForward=endOffset; >>>>>>> endOffset=node.getRightIToken().getEndOffset(); int lookForward=endOffset; <<<<<<< } while(lookForward < getLexStream().getTokenCount() && Character.isWhitespace(getLexStream().getCharValue(lookForward))); return endOffset; ======= } while(lookForward < getLexStream().getStreamLength() && Character.isWhitespace(getLexStream().getCharValue(lookForward))); return endOffset+1; //exclusive end >>>>>>> } while(lookForward < getLexStream().getTokenCount() && Character.isWhitespace(getLexStream().getCharValue(lookForward))); return endOffset+1; //exclusive end
<<<<<<< Collection<IStrategoTerm> nestedCompletionTerms = getNestedCompletionTermsFromAST(completionParseResult); Collection<IStrategoTerm> completionTerms = getCompletionTermsFromAST(completionParseResult); ======= completions.addAll(completionCorrectPrograms(position, parseInput)); >>>>>>> Collection<IStrategoTerm> nestedCompletionTerms = getNestedCompletionTermsFromAST(completionParseResult); Collection<IStrategoTerm> completionTerms = getCompletionTermsFromAST(completionParseResult); <<<<<<< public Collection<ICompletion> completionErroneousPrograms(Iterable<IStrategoTerm> completionTerms, ParseResult<?> completionParseResult) throws MetaborgException { ======= public Collection<ICompletion> completionErroneousPrograms(ISpoofaxParseUnit completionParseResult) throws MetaborgException { >>>>>>> public Collection<ICompletion> completionErroneousPrograms(Iterable<IStrategoTerm> completionTerms, ISpoofaxParseUnit completionParseResult) throws MetaborgException { <<<<<<< IStrategoTerm completionAst = (IStrategoTerm) completionParseResult.result; final StrategoTerm topMostAmb = findTopMostAmbNode((StrategoTerm) completionTerm); final IStrategoTerm inputStratego = termFactory.makeTuple(completionAst, completionTerm, topMostAmb, parenthesizeTerm(completionTerm, termFactory)); ======= IStrategoTerm completionAst = (IStrategoTerm) completionParseResult.ast(); final IStrategoTerm inputStratego = termFactory.makeTuple(completionAst, completionTerm); >>>>>>> IStrategoTerm completionAst = (IStrategoTerm) completionParseResult.ast(); final StrategoTerm topMostAmb = findTopMostAmbNode((StrategoTerm) completionTerm); final IStrategoTerm inputStratego = termFactory.makeTuple(completionAst, completionTerm, topMostAmb, parenthesizeTerm(completionTerm, termFactory));
<<<<<<< import mb.nabl2.spoofax.primitives.SG_solve_final_constraint; import mb.nabl2.spoofax.primitives.SG_solve_initial_constraint; import mb.nabl2.spoofax.primitives.SG_solve_unit_constraint; import mb.statix.spoofax.STX_analyze; ======= import mb.statix.spoofax.STX_solve_constraint; >>>>>>> import mb.nabl2.spoofax.primitives.SG_solve_final_constraint; import mb.nabl2.spoofax.primitives.SG_solve_initial_constraint; import mb.nabl2.spoofax.primitives.SG_solve_unit_constraint; import mb.statix.spoofax.STX_solve_constraint;
<<<<<<< import io.usethesource.capsule.Set; import meta.flowspec.java.solver.FixedPoint; ======= >>>>>>> import io.usethesource.capsule.Set; import meta.flowspec.java.solver.FixedPoint;
<<<<<<< import build.pluto.builder.BuildManagers; import build.pluto.builder.BuildRequest; import build.pluto.builder.RequiredBuilderFailed; import build.pluto.output.Output; import build.pluto.xattr.Xattr; ======= import java.io.File; import java.io.IOException; import java.net.URL; import java.util.Collection; import java.util.Set; import javax.annotation.Nullable; import build.pluto.buildjava.JarBuilder; >>>>>>> import build.pluto.builder.BuildManagers; import build.pluto.builder.BuildRequest; import build.pluto.builder.RequiredBuilderFailed; import build.pluto.output.Output; import build.pluto.xattr.Xattr; <<<<<<< import com.google.inject.Inject; import com.google.inject.Injector; ======= >>>>>>> import com.google.inject.Inject; import com.google.inject.Injector; <<<<<<< this.languageSpecConfigWriter.write(input.languageSpec, input.config, access); // HACK: compile the main ESV file to make sure that packed.esv file is always available. final FileObject mainEsvFile = input.paths.mainEsvFile(); if(mainEsvFile.exists()) { logger.info("Compiling ESV file {}", mainEsvFile); // @formatter:off final BuildInput buildInput = new NewBuildInputBuilder(input.languageSpec) .addSource(mainEsvFile) .addTransformGoal(new CompileGoal()) .withMessagePrinter(new ConsoleBuildMessagePrinter(sourceTextService, false, true, logger)) .build(dependencyService, languagePathService); // @formatter:on runner.build(buildInput, null, null).schedule().block(); } access.addWrite(mainEsvFile); ======= final FileObject settingsFile = input.project.location().resolveFile("src-gen").resolveFile("metaborg.generated.yaml"); settingsFile.createFile(); YAMLProjectSettingsSerializer.write(settingsFile, input.settings.settings()); access.addWrite(settingsFile); >>>>>>> this.languageSpecConfigWriter.write(input.languageSpec, input.config, access); <<<<<<< input.paths.strJavaTransFolder().delete(selector); input.paths.includeFolder().delete(selector); input.paths.generatedSourceFolder().delete(selector); input.paths.cacheFolder().delete(selector); ======= settings.getStrJavaTransDirectory().delete(selector); settings.getIncludeDirectory().delete(selector); settings.getGenSourceDirectory().delete(selector); settings.getCacheDirectory().delete(selector); settings.getDsGeneratedInterpreterJava().delete(FileSelectorUtils.extension("java")); >>>>>>> input.paths.strJavaTransFolder().delete(selector); input.paths.includeFolder().delete(selector); input.paths.generatedSourceFolder().delete(selector); input.paths.cacheFolder().delete(selector); input.paths.dsGeneratedInterpreterJava().delete(FileSelectorUtils.extension("java"));
<<<<<<< protected SdfVersion sdfVersion = SdfVersion.sdf3; protected @Nullable Sdf2tableVersion sdf2tableVersion; protected @Nullable PlaceholderCharacters placeholderCharacters = null; protected @Nullable String sdfExternalDef = null; protected Arguments sdfArgs = new Arguments(); protected StrategoFormat strFormat = StrategoFormat.ctree; protected @Nullable String strExternalJar = null; protected @Nullable String strExternalJarFlags = null; protected Arguments strArgs = new Arguments(); protected Collection<IBuildStepConfig> buildSteps = Lists.newArrayList(); ======= protected @Nullable SdfVersion sdfVersion; protected @Nullable Sdf2tableVersion sdf2tableVersion; protected @Nullable String sdfExternalDef; protected @Nullable Arguments sdfArgs; protected @Nullable StrategoFormat strFormat; protected @Nullable String strExternalJar; protected @Nullable String strExternalJarFlags; protected @Nullable Arguments strArgs; protected @Nullable Collection<IBuildStepConfig> buildSteps; >>>>>>> protected @Nullable SdfVersion sdfVersion; protected @Nullable Sdf2tableVersion sdf2tableVersion; protected @Nullable PlaceholderCharacters placeholderCharacters; protected @Nullable String sdfExternalDef; protected @Nullable Arguments sdfArgs; protected @Nullable StrategoFormat strFormat; protected @Nullable String strExternalJar; protected @Nullable String strExternalJarFlags; protected @Nullable Arguments strArgs; protected @Nullable Collection<IBuildStepConfig> buildSteps; <<<<<<< final JacksonConfiguration configuration = configReaderWriter.create(null, rootFolder); return new SpoofaxLanguageSpecConfig(configuration, identifier, name, compileDeps, sourceDeps, javaDeps, langContribs, generates, exports, metaborgVersion, pardonedLanguages, useBuildSystemSpec, SdfVersion.sdf3, sdf2tableVersion, placeholderCharacters, sdfExternalDef, sdfArgs, strFormat, strExternalJar, strExternalJarFlags, strArgs, buildSteps); ======= final SpoofaxLanguageSpecConfig config = new SpoofaxLanguageSpecConfig(configuration, identifier, name, compileDeps, sourceDeps, javaDeps, typesmart, langContribs, generates, exports, metaborgVersion, pardonedLanguages, useBuildSystemSpec, sdfVersion, sdf2tableVersion, sdfExternalDef, sdfArgs, strFormat, strExternalJar, strExternalJarFlags, strArgs, buildSteps); return config; >>>>>>> final SpoofaxLanguageSpecConfig config = new SpoofaxLanguageSpecConfig(configuration, identifier, name, compileDeps, sourceDeps, javaDeps, typesmart, langContribs, generates, exports, metaborgVersion, pardonedLanguages, useBuildSystemSpec, sdfVersion, sdf2tableVersion, placeholderCharacters, sdfExternalDef, sdfArgs, strFormat, strExternalJar, strExternalJarFlags, strArgs, buildSteps); return config; <<<<<<< this.sdfVersion = SdfVersion.sdf3; sdf2tableVersion = null; this.placeholderCharacters = new PlaceholderCharacters("\"[[\"", "\"]]\""); this.sdfExternalDef = null; this.sdfArgs.clear(); this.strFormat = StrategoFormat.ctree; this.strExternalJar = null; this.strExternalJarFlags = null; this.strArgs.clear(); this.buildSteps.clear(); ======= sdfVersion = null; sdf2tableVersion = null; sdfExternalDef = null; sdfArgs = null; strFormat = null; strExternalJar = null; strExternalJarFlags = null; strArgs = null; buildSteps = null; >>>>>>> sdfVersion = null; sdf2tableVersion = null; this.placeholderCharacters = null; sdfExternalDef = null; sdfArgs = null; strFormat = null; strExternalJar = null; strExternalJarFlags = null; strArgs = null; buildSteps = null; <<<<<<< withSdfVersion(config.sdfVersion()); withSdf2tableVersion(config.sdf2tableVersion()); withPlaceholderPrefix(config.placeholderChars().prefix); withPlaceholderPostfix(config.placeholderChars().suffix); withSdfExternalDef(config.sdfExternalDef()); withStrFormat(config.strFormat()); withSdfArgs(config.sdfArgs()); withStrExternalJar(config.strExternalJar()); withStrExternalJarFlags(config.strExternalJarFlags()); withStrArgs(config.strArgs()); withBuildSteps(config.buildSteps()); ======= if(!(config instanceof IConfig)) { withSdfVersion(config.sdfVersion()); withSdf2tableVersion(config.sdf2tableVersion()); withSdfExternalDef(config.sdfExternalDef()); withSdfArgs(config.sdfArgs()); withStrFormat(config.strFormat()); withStrExternalJar(config.strExternalJar()); withStrExternalJarFlags(config.strExternalJarFlags()); withStrArgs(config.strArgs()); withBuildSteps(config.buildSteps()); } return this; } @Override public ISpoofaxLanguageSpecConfigBuilder withMetaborgVersion(String metaborgVersion) { super.withMetaborgVersion(metaborgVersion); >>>>>>> if(!(config instanceof IConfig)) { withSdfVersion(config.sdfVersion()); withSdf2tableVersion(config.sdf2tableVersion()); withPlaceholderPrefix(config.placeholderChars().prefix); withPlaceholderPostfix(config.placeholderChars().suffix); withSdfExternalDef(config.sdfExternalDef()); withSdfArgs(config.sdfArgs()); withStrFormat(config.strFormat()); withStrExternalJar(config.strExternalJar()); withStrExternalJarFlags(config.strExternalJarFlags()); withStrArgs(config.strArgs()); withBuildSteps(config.buildSteps()); } return this; } @Override public ISpoofaxLanguageSpecConfigBuilder withMetaborgVersion(String metaborgVersion) { super.withMetaborgVersion(metaborgVersion);
<<<<<<< new LanguageSpecConfig(configuration, projectConfig, identifier, name, sdfEnabled, parseTable, completionsParseTable, jsglrVersion, langContribs, generates, exports, pardonedLanguages, useBuildSystemSpec); ======= new LanguageSpecConfig(configuration, projectConfig, identifier, name, sdfEnabled, sdf2tableVersion, parseTable, completionsParseTable, langContribs, generates, exports, pardonedLanguages, useBuildSystemSpec); >>>>>>> new LanguageSpecConfig(configuration, projectConfig, identifier, name, sdfEnabled, sdf2tableVersion, parseTable, completionsParseTable, jsglrVersion, langContribs, generates, exports, pardonedLanguages, useBuildSystemSpec);
<<<<<<< import com.morristaedt.mirror.modules.NewsModule; ======= import com.morristaedt.mirror.modules.MoodModule; >>>>>>> import com.morristaedt.mirror.modules.MoodModule; import com.morristaedt.mirror.modules.NewsModule; <<<<<<< private TextView mNewsHeadline; ======= private MoodModule moodModule; private TextView mCalendarTitleText; private TextView mCalendarDetailsText; >>>>>>> private TextView mNewsHeadline; private MoodModule moodModule; private TextView mCalendarTitleText; private TextView mCalendarDetailsText; <<<<<<< private NewsModule.NewsListener mNewsListener = new NewsModule.NewsListener() { @Override public void onNewNews(String headline) { if (TextUtils.isEmpty(headline)) { mNewsHeadline.setVisibility(View.GONE); } else { mNewsHeadline.setVisibility(View.VISIBLE); mNewsHeadline.setText(headline); mNewsHeadline.setSelected(true); } } }; ======= private MoodModule.MoodListener mMoodListener = new MoodModule.MoodListener() { @Override public void onShouldGivePositiveAffirmation(final String affirmation) { runOnUiThread(new Runnable() { @Override public void run() { mMoodText.setVisibility(affirmation == null ? View.GONE : View.VISIBLE); mMoodText.setText(affirmation); } }); } }; private CalendarModule.CalendarListener mCalendarListener = new CalendarModule.CalendarListener() { @Override public void onCalendarUpdate(String title, String details) { mCalendarTitleText.setVisibility(title != null ? View.VISIBLE : View.GONE); mCalendarTitleText.setText(title); mCalendarDetailsText.setVisibility(details != null ? View.VISIBLE : View.GONE); mCalendarDetailsText.setText(details); //Make marquee effect work for long text mCalendarTitleText.setSelected(true); mCalendarDetailsText.setSelected(true); } }; >>>>>>> private NewsModule.NewsListener mNewsListener = new NewsModule.NewsListener() { @Override public void onNewNews(String headline) { if (TextUtils.isEmpty(headline)) { mNewsHeadline.setVisibility(View.GONE); } else { mNewsHeadline.setVisibility(View.VISIBLE); mNewsHeadline.setText(headline); mNewsHeadline.setSelected(true); } } }; private MoodModule.MoodListener mMoodListener = new MoodModule.MoodListener() { @Override public void onShouldGivePositiveAffirmation(final String affirmation) { runOnUiThread(new Runnable() { @Override public void run() { mMoodText.setVisibility(affirmation == null ? View.GONE : View.VISIBLE); mMoodText.setText(affirmation); } }); } }; private CalendarModule.CalendarListener mCalendarListener = new CalendarModule.CalendarListener() { @Override public void onCalendarUpdate(String title, String details) { mCalendarTitleText.setVisibility(title != null ? View.VISIBLE : View.GONE); mCalendarTitleText.setText(title); mCalendarDetailsText.setVisibility(details != null ? View.VISIBLE : View.GONE); mCalendarDetailsText.setText(details); //Make marquee effect work for long text mCalendarTitleText.setSelected(true); mCalendarDetailsText.setSelected(true); } }; <<<<<<< mNewsHeadline = (TextView) findViewById(R.id.news_headline); ======= mCalendarTitleText = (TextView) findViewById(R.id.calendar_title); mCalendarDetailsText = (TextView) findViewById(R.id.calendar_details); >>>>>>> mNewsHeadline = (TextView) findViewById(R.id.news_headline); mCalendarTitleText = (TextView) findViewById(R.id.calendar_title); mCalendarDetailsText = (TextView) findViewById(R.id.calendar_details); <<<<<<< NewsModule.getNewsHeadline(this, mNewsListener); ======= CalendarModule.getCalendarEvents(this, mCalendarListener); >>>>>>> NewsModule.getNewsHeadline(this, mNewsListener); CalendarModule.getCalendarEvents(this, mCalendarListener);
<<<<<<< import android.provider.Contacts.ContactMethodsColumns; ======= >>>>>>>
<<<<<<< buttonCall = (ImageButton) findViewById(R.id.buttonCall); buttonHangup = (ImageButton) findViewById(R.id.buttonHangUp); buttonIncomingCall = (ImageButton) findViewById(R.id.buttonIncomingCall); ManagerImpl.setAppPath(getAppPath()); managerImpl = new ManagerImpl(callbackHandler); managerImpl.setActivity(this); // managerImpl.setCallButton(buttonCall); Log.i(TAG, "managerImpl created with callbackHandler " + callbackHandler); ======= manager = new Manager(callbackHandler); Log.i(TAG, "ManagerImpl::instance() = " + manager.managerImpl); manager.setActivity(this); /* set static AppPath before calling manager.init */ manager.managerImpl.setPath(getAppPath()); Log.i(TAG, "manager created with callbackHandler " + callbackHandler); buttonCall = (ImageButton) findViewById(R.id.buttonCall); buttonHangup = (ImageButton) findViewById(R.id.buttonHangUp); // buttonIncomingCall = (ImageButton) findViewById(R.id.buttonIncomingCall); >>>>>>> buttonCall = (ImageButton) findViewById(R.id.buttonCall); buttonHangup = (ImageButton) findViewById(R.id.buttonHangUp); buttonIncomingCall = (ImageButton) findViewById(R.id.buttonIncomingCall); manager = new Manager(callbackHandler); Log.i(TAG, "ManagerImpl::instance() = " + manager.managerImpl); manager.setActivity(this); /* set static AppPath before calling manager.init */ manager.managerImpl.setPath(getAppPath()); Log.i(TAG, "manager created with callbackHandler " + callbackHandler); <<<<<<< fragment = new ButtonSectionFragment(); Log.i(TAG, "getItem: fragment is " + fragment); ======= buttonFragment = new ButtonSectionFragment(); Log.i(TAG, "getItem: fragment is " + buttonFragment); fragment = buttonFragment; manager.setButtonFragment(buttonFragment); >>>>>>> fragment = new ButtonSectionFragment(); Log.i(TAG, "getItem: fragment is " + fragment);
<<<<<<< @Override public RuntimeInstance getRuntimeInstance(String serviceName, String serviceIp, int servicePort) { ZkServiceInfo zkInfo = zkInfos.get(serviceName); if (zkInfo == null) { return null; } List<RuntimeInstance> runtimeInstances = zkInfo.getRuntimeInstances(); for (RuntimeInstance runtimeInstance : runtimeInstances){ if (runtimeInstance.ip.equals(serviceIp)&&runtimeInstance.port == servicePort){ return runtimeInstance; } } return null; } private SoaConnection findConnection(String service, String version, String method) throws SoaException { ======= private SoaConnection findConnection(final String service, final String version, final String method) throws SoaException { >>>>>>> @Override public RuntimeInstance getRuntimeInstance(String serviceName, String serviceIp, int servicePort) { ZkServiceInfo zkInfo = zkInfos.get(serviceName); if (zkInfo == null) { return null; } List<RuntimeInstance> runtimeInstances = zkInfo.getRuntimeInstances(); for (RuntimeInstance runtimeInstance : runtimeInstances){ if (runtimeInstance.ip.equals(serviceIp)&&runtimeInstance.port == servicePort){ return runtimeInstance; } } return null; } private SoaConnection findConnection(final String service, final String version, final String method) throws SoaException { <<<<<<< //在途请求数+1 inst.increaseActiveCount(); ======= inst.increaseActiveCount(); >>>>>>> inst.increaseActiveCount();
<<<<<<< private Map<String, ZkServiceInfo> zkInfos = new ConcurrentHashMap<>(); ======= private Map<IpPort, SubPool> subPools = new ConcurrentHashMap<>(); >>>>>>> private Map<String, ZkServiceInfo> zkInfos = new ConcurrentHashMap<>(); <<<<<<< private Map<String, ClientInfoWeakRef> clientInfos = new ConcurrentHashMap<>(16); ======= private ReentrantLock subPoolLock = new ReentrantLock(); private Map<String, ClientInfoWeakRef> clientInfos = new ConcurrentHashMap<>(128); >>>>>>> private Map<String, ClientInfoWeakRef> clientInfos = new ConcurrentHashMap<>(16); <<<<<<< ======= ZkServiceInfo zkInfo = zkServiceInfoMap.get(service); >>>>>>>
<<<<<<< Builder(String id){ this.id = id; } ======= /** * Sets pickup-location. * * @param pickupLocation * @return builder * @throws IllegalArgumentException if location is null */ >>>>>>> Builder(String id){ this.id = id; } /** * Sets pickup-location. * * @param pickupLocation * @return builder * @throws IllegalArgumentException if location is null */ <<<<<<< public Builder addCapacityDimension(int dimIndex, int dimVal) { capacityBuilder.addDimension(dimIndex, dimVal); return this; } ======= /** * Builds the shipment. * * @return shipment * @throws IllegalStateException if neither pickup-location nor pickup-coord is set or if neither delivery-location nor delivery-coord * is set */ >>>>>>> /** * Adds capacity dimension. * * @param dimIndex * @param dimVal * @return */ public Builder addCapacityDimension(int dimIndex, int dimVal) { capacityBuilder.addDimension(dimIndex, dimVal); return this; } /** * Builds the shipment. * * @return shipment * @throws IllegalStateException if neither pickup-location nor pickup-coord is set or if neither delivery-location nor delivery-coord * is set */ <<<<<<< private final TimeWindow pickupTimeWindow; private final Capacity capacity; ======= private final TimeWindow pickupTimeWindow; >>>>>>> private final TimeWindow pickupTimeWindow; private final Capacity capacity;
<<<<<<< if (invocationContext.lastInvocationInfo().responseCode() == null) { ((InvocationInfoImpl)invocationContext.lastInvocationInfo()).responseCode(soaException.getCode()); } ======= >>>>>>> if (invocationContext.lastInvocationInfo().responseCode() == null) { ((InvocationInfoImpl)invocationContext.lastInvocationInfo()).responseCode(soaException.getCode()); }
<<<<<<< SoaHeader soaHeader = transactionContext.getHeader(); ======= // parser.service, version, method, header, bodyProtocol SoaHeader soaHeader = parser.parseSoaMessage(context); context.setHeader(soaHeader); updateTransactionCtx(context,soaHeader); >>>>>>> SoaHeader soaHeader = transactionContext.getHeader(); <<<<<<< ======= private SoaException convertToSoaException(Throwable ex) { SoaException soaException = null; if (ex instanceof SoaException) { soaException = (SoaException) ex; } else { soaException = new SoaException(SoaCode.UnKnown.getCode(), ex.getMessage()); } return soaException; } private void updateTransactionCtx(TransactionContext ctx, SoaHeader soaHeader) { ctx.setCallerFrom(soaHeader.getCallerFrom()); ctx.setCallerIp(soaHeader.getCallerIp()); ctx.setCustomerId(soaHeader.getCustomerId()); ctx.setCustomerName(soaHeader.getCustomerName()); ctx.setOperatorId(soaHeader.getOperatorId()); ctx.setOperatorName(soaHeader.getOperatorName()); } >>>>>>>
<<<<<<< public class ServerZk implements Watcher { ======= public class ServerZk extends CommonZk { >>>>>>> public class ServerZk implements Watcher { <<<<<<< private ZooKeeper zk; private String zkHost = SoaSystemEnvProperties.SOA_ZOOKEEPER_HOST; ======= >>>>>>> private ZooKeeper zk; private String zkHost = SoaSystemEnvProperties.SOA_ZOOKEEPER_HOST; <<<<<<< destroy(); ======= if (zk != null) { zk.close(); zk = null; } >>>>>>> destroy();
<<<<<<< LOGGER.warn("unRegister service: " + serviceName + " " + version); registryAgent.unregisterService(serviceName,version); ======= LOGGER.info(getClass().getSimpleName() + "::unRegisterService [serviceName:" + serviceName + ", version:" + version + "]"); // TODO do something real? >>>>>>> LOGGER.info(getClass().getSimpleName() + "::unRegisterService [serviceName:" + serviceName + ", version:" + version + "]"); registryAgent.unregisterService(serviceName,version);
<<<<<<< LOGGER.warn("Plugin::" + getClass().getSimpleName() + "::start"); ======= LOGGER.warn("Plugin::ZooKeeperRegistryPlugin start"); /** * set RegistryAgentImpl ,SoaServerHandler 会用到 */ >>>>>>> LOGGER.warn("Plugin::" + getClass().getSimpleName() + "::start"); /** * set RegistryAgentImpl ,SoaServerHandler 会用到 */
<<<<<<< import com.fasterxml.jackson.annotation.JsonFilter; import com.fasterxml.jackson.annotation.JsonFormat; ======= >>>>>>> import com.fasterxml.jackson.annotation.JsonFilter; import com.fasterxml.jackson.annotation.JsonFormat; <<<<<<< jsonObjectMapper.configOverride(Date.class).setFormat(JsonFormat.Value.forPattern("yyyy-MM-dd'T'HH:mm:ssZ")); SimpleFilterProvider filters = new SimpleFilterProvider(); // haven't found out, how to stack filters. Copying the validation one for now. filters.addFilter("validateFilter", SimpleBeanPropertyFilter.serializeAllExcept("valid", "validationErrors")); filters.addFilter("pkPassFilter", SimpleBeanPropertyFilter.serializeAllExcept("valid", "validationErrors", "foregroundColorAsObject", "backgroundColorAsObject", "labelColorAsObject", "passThatWasSet")); filters.addFilter("barcodeFilter", SimpleBeanPropertyFilter.serializeAllExcept("valid", "validationErrors", "messageEncodingAsString", "validInIosVersionsBefore9")); filters.addFilter("charsetFilter", SimpleBeanPropertyFilter.filterOutAllExcept("name")); ======= >>>>>>> jsonObjectMapper.configOverride(Date.class).setFormat(JsonFormat.Value.forPattern("yyyy-MM-dd'T'HH:mm:ssZ")); filters.addFilter("charsetFilter", SimpleBeanPropertyFilter.filterOutAllExcept("name")); SimpleBeanPropertyFilter.serializeAllExcept("valid", "validationErrors", "messageEncodingAsString", "validInIosVersionsBefore9")); "backgroundColorAsObject", "labelColorAsObject", "passThatWasSet")); filters.addFilter("barcodeFilter", filters.addFilter("pkPassFilter", SimpleBeanPropertyFilter.serializeAllExcept("valid", "validationErrors", "foregroundColorAsObject", filters.addFilter("validateFilter", SimpleBeanPropertyFilter.serializeAllExcept("valid", "validationErrors")); // haven't found out, how to stack filters. Copying the validation one for now. SimpleFilterProvider filters = new SimpleFilterProvider();
<<<<<<< PKPass pass = new ObjectMapper().readValue(new File(getPathFromClasspath("pass.json")), PKPass.class); pass.setRelevantDate(new Date()); pass.getBarcodes().get(0).setMessageEncoding(Charset.forName("utf-8")); pass.setUserInfo(ImmutableMap.<String, Object> of("name", "John Doe")); ======= PKPass pass = new ObjectMapper().readValue(new File(getPathFromClasspath("pass2.json")), PKPass.class); PKPassBuilder passBuilder = PKPass.builder(pass) .relevantDate(new Date()) .userInfo(Collections.<String, Object>singletonMap("name", "John Doe")); >>>>>>> PKPass pass = new ObjectMapper().readValue(new File(getPathFromClasspath("pass.json")), PKPass.class); PKPassBuilder passBuilder = PKPass.builder(pass) .relevantDate(new Date()) .userInfo(Collections.<String, Object>singletonMap("name", "John Doe"));
<<<<<<< private Persistancy persistancy = new Persistancy(); ======= private MessageBar messageBar = new MessageBar(); >>>>>>> private MessageBar messageBar = new MessageBar(); private Persistancy persistancy = new Persistancy();
<<<<<<< if (selectionController.hasCurrentSelection()) { this.selected = (PaneBox) arg; ======= if (selectionController.hasSelection()) { this.selected = (Selectable) arg; >>>>>>> if (selectionController.hasCurrentSelection()) { this.selected = (Selectable) arg;
<<<<<<< import ch.hsr.ogv.model.RelationType; import ch.hsr.ogv.model.ModelBox.ModelBoxChange; ======= >>>>>>> import ch.hsr.ogv.model.RelationType; <<<<<<< changedArrow.setPoints(changedBox, friendChangedBox); endpoint.setCoordinates(changedArrow.getStartPoint()); friendEndpoint.setCoordinates(changedArrow.getEndPoint()); ======= changedArrow.setPointsBasedOnBoxes(changedBox, friendChangedBox); >>>>>>> changedArrow.setPoints(changedBox, friendChangedBox); <<<<<<< changedArrow.setPoints(friendChangedBox, changedBox); friendEndpoint.setCoordinates(changedArrow.getStartPoint()); endpoint.setCoordinates(changedArrow.getEndPoint()); ======= changedArrow.setPointsBasedOnBoxes(friendChangedBox, changedBox); >>>>>>> changedArrow.setPoints(friendChangedBox, changedBox);
<<<<<<< // Ordering is critical here, especially for Junction private static final Ordering<BlockingState> BLOCKING_STATE_ORDERING = Ordering.<BlockingState>from(new Comparator<BlockingState>() { ======= public static final Ordering<BlockingState> BLOCKING_STATE_ORDERING = Ordering.<BlockingState>from(new Comparator<BlockingState>() { >>>>>>> // Ordering is critical here, especially for Junction public static final Ordering<BlockingState> BLOCKING_STATE_ORDERING = Ordering.<BlockingState>from(new Comparator<BlockingState>() {
<<<<<<< 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); <<<<<<< return new RecurringInvoiceItem(invoiceId, subscriptionId, bundleId, planName, phaseName, startDate, endDate, amountNegated, rate, currency, id, createdDate); ======= return new RecurringInvoiceItem(invoiceId, accountId, subscriptionId, planName, phaseName, startDate, endDate, amountNegated, rate, currency, id); >>>>>>> return new RecurringInvoiceItem(invoiceId, accountId, bundleId, subscriptionId, planName, phaseName, startDate, endDate, amountNegated, rate, currency, id);
<<<<<<< ======= import com.google.common.base.Optional; >>>>>>> import com.google.common.base.Optional;
<<<<<<< import org.killbill.billing.catalog.DefaultTierPriceOverride; import org.killbill.billing.catalog.DefaultTieredBlockPriceOverride; import org.killbill.billing.catalog.DefaultUsagePriceOverride; ======= import org.killbill.billing.catalog.StandaloneCatalog; >>>>>>> import org.killbill.billing.catalog.DefaultTierPriceOverride; import org.killbill.billing.catalog.DefaultTieredBlockPriceOverride; import org.killbill.billing.catalog.DefaultUsagePriceOverride; import org.killbill.billing.catalog.StandaloneCatalog; <<<<<<< final PlanPhasePriceOverride[] overrides = createOverrides(defaultPlan, phaseDefs, context); return new DefaultPlan(planName, defaultPlan, overrides); ======= final PlanPhasePriceOverride[] overrides = createOverrides(defaultPlan, phaseDefs); final DefaultPlan result = new DefaultPlan(planName, defaultPlan, overrides); result.initialize((StandaloneCatalog) catalog, ((StandaloneCatalog) catalog).getCatalogURI()); return result; >>>>>>> final PlanPhasePriceOverride[] overrides = createOverrides(defaultPlan, phaseDefs, context); final DefaultPlan result = new DefaultPlan(planName, defaultPlan, overrides); result.initialize((StandaloneCatalog) catalog, ((StandaloneCatalog) catalog).getCatalogURI()); return result;
<<<<<<< return new InternalCallContext(tenantRecordId, context, clock.getUTCNow()); ======= populateMDCContext(null, tenantRecordId); return new InternalCallContext(tenantRecordId, context); >>>>>>> populateMDCContext(null, tenantRecordId); return new InternalCallContext(tenantRecordId, context, clock.getUTCNow()); <<<<<<< final DateTimeZone fixedOffsetTimeZone = getFixedOffsetTimeZone(accountRecordId, context.getTenantRecordId()); final DateTime referenceTime = getReferenceTime(accountRecordId, context.getTenantRecordId()); return new InternalCallContext(context, accountRecordId, fixedOffsetTimeZone, referenceTime, clock.getUTCNow()); ======= final DateTimeZone accountTimeZone = getAccountTimeZone(context.getTenantRecordId(), accountRecordId); populateMDCContext(accountRecordId, context.getTenantRecordId()); return new InternalCallContext(context, accountRecordId, accountTimeZone); >>>>>>> final DateTimeZone fixedOffsetTimeZone = getFixedOffsetTimeZone(accountRecordId, context.getTenantRecordId()); final DateTime referenceTime = getReferenceTime(accountRecordId, context.getTenantRecordId()); populateMDCContext(accountRecordId, context.getTenantRecordId()); return new InternalCallContext(context, accountRecordId, fixedOffsetTimeZone, referenceTime, clock.getUTCNow());
<<<<<<< final Injector injector = Guice.createInjector(new TestPaymentModuleNoDB(getClock())); ======= loadSystemPropertiesFromClasspath("/resource.properties"); final Injector injector = Guice.createInjector(new TestPaymentModuleNoDB(configSource, getClock())); >>>>>>> final Injector injector = Guice.createInjector(new TestPaymentModuleNoDB(configSource, getClock()));
<<<<<<< recurringPrice.getPrice(currency), currency, BillingPeriod.MONTHLY, 1, BillingModeType.IN_ADVANCE, "testEvent1", SubscriptionTransitionType.CREATE); ======= recurringPrice, BillingPeriod.MONTHLY, 1, BillingModeType.IN_ADVANCE, "testEvent1", 1L, SubscriptionTransitionType.CREATE); >>>>>>> recurringPrice.getPrice(currency), currency, BillingPeriod.MONTHLY, 1, BillingModeType.IN_ADVANCE, "testEvent1", 1L, SubscriptionTransitionType.CREATE); <<<<<<< recurringPrice2.getPrice(currency), currency, BillingPeriod.MONTHLY, 1, BillingModeType.IN_ADVANCE, "testEvent2", SubscriptionTransitionType.CREATE); ======= recurringPrice2, BillingPeriod.MONTHLY, 1, BillingModeType.IN_ADVANCE, "testEvent2", 1L, SubscriptionTransitionType.CREATE); >>>>>>> recurringPrice2.getPrice(currency), currency, BillingPeriod.MONTHLY, 1, BillingModeType.IN_ADVANCE, "testEvent2", 2L, SubscriptionTransitionType.CREATE); <<<<<<< recurringPrice.getPrice(currency), currency, BillingPeriod.MONTHLY, 15, BillingModeType.IN_ADVANCE, "testEvent", SubscriptionTransitionType.CREATE); ======= recurringPrice, BillingPeriod.MONTHLY, 15, BillingModeType.IN_ADVANCE, "testEvent", 1L, SubscriptionTransitionType.CREATE); >>>>>>> recurringPrice.getPrice(currency), currency, BillingPeriod.MONTHLY, 15, BillingModeType.IN_ADVANCE, "testEvent", 1L, SubscriptionTransitionType.CREATE); <<<<<<< BillingEvent event1 = new DefaultBillingEvent(subscription, effectiveDate1, plan, phase1, fixedPrice.getPrice(currency), null, currency, BillingPeriod.MONTHLY, 1, BillingModeType.IN_ADVANCE, "testEvent1", SubscriptionTransitionType.CREATE); ======= BillingEvent event1 = new DefaultBillingEvent(subscription, effectiveDate1, plan, phase1, fixedPrice, null, BillingPeriod.MONTHLY, 1, BillingModeType.IN_ADVANCE, "testEvent1", 1L, SubscriptionTransitionType.CREATE); >>>>>>> BillingEvent event1 = new DefaultBillingEvent(subscription, effectiveDate1, plan, phase1, fixedPrice.getPrice(currency), null, currency, BillingPeriod.MONTHLY, 1, BillingModeType.IN_ADVANCE, "testEvent1", 1L, SubscriptionTransitionType.CREATE); <<<<<<< recurringPrice.getPrice(currency), currency, BillingPeriod.MONTHLY, 31, BillingModeType.IN_ADVANCE, "testEvent2", SubscriptionTransitionType.CHANGE); ======= recurringPrice, BillingPeriod.MONTHLY, 31, BillingModeType.IN_ADVANCE, "testEvent2", 1L, SubscriptionTransitionType.CHANGE); >>>>>>> recurringPrice.getPrice(currency), currency, BillingPeriod.MONTHLY, 31, BillingModeType.IN_ADVANCE, "testEvent2", 2L, SubscriptionTransitionType.CHANGE); <<<<<<< BillingEvent event1 = new DefaultBillingEvent(subscription, effectiveDate1, plan, phase1, fixedPrice.getPrice(currency), null, currency, BillingPeriod.MONTHLY, 1, BillingModeType.IN_ADVANCE, "testEvent1", SubscriptionTransitionType.CREATE); ======= BillingEvent event1 = new DefaultBillingEvent(subscription, effectiveDate1, plan, phase1, fixedPrice, null, BillingPeriod.MONTHLY, 1, BillingModeType.IN_ADVANCE, "testEvent1", 1L, SubscriptionTransitionType.CREATE); >>>>>>> BillingEvent event1 = new DefaultBillingEvent(subscription, effectiveDate1, plan, phase1, fixedPrice.getPrice(currency), null, currency, BillingPeriod.MONTHLY, 1, BillingModeType.IN_ADVANCE, "testEvent1", 1L, SubscriptionTransitionType.CREATE); <<<<<<< recurringPrice.getPrice(currency), currency, BillingPeriod.MONTHLY, 31, BillingModeType.IN_ADVANCE, "testEvent2", SubscriptionTransitionType.CHANGE); ======= recurringPrice, BillingPeriod.MONTHLY, 31, BillingModeType.IN_ADVANCE, "testEvent2", 1L, SubscriptionTransitionType.CHANGE); >>>>>>> recurringPrice.getPrice(currency), currency, BillingPeriod.MONTHLY, 31, BillingModeType.IN_ADVANCE, "testEvent2", 2L, SubscriptionTransitionType.CHANGE);
<<<<<<< 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.entitlement.api.billing.DefaultEntitlementBillingApi; import com.ning.billing.entitlement.api.billing.EntitlementBillingApi; 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.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.google.inject.name.Names; ======= import com.ning.billing.account.api.AccountUserApi; import com.ning.billing.account.api.MockAccountUserApi; >>>>>>> import com.google.inject.name.Names; <<<<<<< 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.billing.ChargeThruApi; >>>>>>> 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.engine.dao.RepairEntitlementDao; import com.ning.billing.entitlement.glue.EntitlementModule; ======= import com.ning.billing.invoice.InvoiceDispatcher; >>>>>>> import com.ning.billing.entitlement.engine.dao.RepairEntitlementDao; import com.ning.billing.entitlement.glue.EntitlementModule; <<<<<<< bind(EntitlementBillingApi.class).to(DefaultEntitlementBillingApi.class).asEagerSingleton(); bind(EntitlementUserApi.class).to(DefaultEntitlementUserApi.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(ChargeThruApi.class).toInstance(BrainDeadProxyFactory.createBrainDeadProxyFor(ChargeThruApi.class)); } >>>>>>> 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(ChargeThruApi.class).toInstance(BrainDeadProxyFactory.createBrainDeadProxyFor(ChargeThruApi.class)); }
<<<<<<< import sun.reflect.generics.reflectiveObjects.NotImplementedException; ======= import java.math.BigDecimal; >>>>>>> <<<<<<< import org.joda.time.DateTimeZone; ======= import org.joda.time.DateTimeZone; import sun.reflect.generics.reflectiveObjects.NotImplementedException; >>>>>>> import org.joda.time.DateTimeZone; <<<<<<< ======= @Override public BigDecimal getBalance() { return BigDecimal.ZERO; } @Override public DateTime getCreatedDate() { return new DateTime(DateTimeZone.UTC); } @Override public DateTime getUpdatedDate() { return new DateTime(DateTimeZone.UTC); } >>>>>>> @Override public DateTime getCreatedDate() { return new DateTime(DateTimeZone.UTC); } @Override public DateTime getUpdatedDate() { return new DateTime(DateTimeZone.UTC); }
<<<<<<< final PaymentModelDao payment = new PaymentModelDao(account.getId(), invoice.getId(), requestedAmount.setScale(2, RoundingMode.HALF_EVEN), invoice.getCurrency(), invoice.getTargetDate()); ======= final boolean scheduleRetryForPayment = !isInstantPayment; final PaymentModelDao payment = new PaymentModelDao(account.getId(), invoice.getId(), account.getPaymentMethodId(), requestedAmount.setScale(2, RoundingMode.HALF_EVEN), invoice.getCurrency(), invoice.getTargetDate()); >>>>>>> final PaymentModelDao payment = new PaymentModelDao(account.getId(), invoice.getId(), account.getPaymentMethodId(), requestedAmount.setScale(2, RoundingMode.HALF_EVEN), invoice.getCurrency(), invoice.getTargetDate());
<<<<<<< import com.google.inject.name.Names; ======= import org.skife.config.ConfigurationObjectFactory; import org.skife.jdbi.v2.IDBI; >>>>>>> import com.google.inject.name.Names; import org.skife.config.ConfigurationObjectFactory; import org.skife.jdbi.v2.IDBI; <<<<<<< import com.ning.billing.entitlement.engine.dao.RepairEntitlementDao; import com.ning.billing.util.clock.Clock; import com.ning.billing.util.clock.ClockMock; ======= >>>>>>> import com.ning.billing.entitlement.engine.dao.RepairEntitlementDao;
<<<<<<< private PriceList priceList; ======= >>>>>>> private PriceList priceList; <<<<<<< @Override public PriceList getPriceList() { return priceList; } /* (non-Javadoc) * @see org.killbill.billing.catalog.IPlan#getName() */ ======= public DefaultPlan setProduct(final DefaultProduct product) { this.product = product; return this; } >>>>>>> @Override public PriceList getPriceList() { return priceList; } <<<<<<< public void setEffectiveDateForExistingSubscriptons( final Date effectiveDateForExistingSubscriptons) { this.effectiveDateForExistingSubscriptons = effectiveDateForExistingSubscriptons; } public DefaultPlan setName(final String name) { this.name = name; return this; } public DefaultPlan setFinalPhase(final DefaultPlanPhase finalPhase) { this.finalPhase = finalPhase; return this; } public DefaultPlan setProduct(final DefaultProduct product) { this.product = product; return this; } public DefaultPlan setPriceList(final DefaultPriceList priceList) { this.priceList = priceList; return this; } public DefaultPlan setInitialPhases(final DefaultPlanPhase[] phases) { this.initialPhases = phases; return this; } public DefaultPlan setPlansAllowedInBundle(final Integer plansAllowedInBundle) { this.plansAllowedInBundle = plansAllowedInBundle; return this; } ======= >>>>>>> public void setEffectiveDateForExistingSubscriptons( final Date effectiveDateForExistingSubscriptons) { this.effectiveDateForExistingSubscriptons = effectiveDateForExistingSubscriptons; } public DefaultPlan setName(final String name) { this.name = name; return this; } public DefaultPlan setFinalPhase(final DefaultPlanPhase finalPhase) { this.finalPhase = finalPhase; return this; } public DefaultPlan setProduct(final DefaultProduct product) { this.product = product; return this; } public DefaultPlan setPriceList(final DefaultPriceList priceList) { this.priceList = priceList; return this; } public DefaultPlan setInitialPhases(final DefaultPlanPhase[] phases) { this.initialPhases = phases; return this; } public DefaultPlan setPlansAllowedInBundle(final Integer plansAllowedInBundle) { this.plansAllowedInBundle = plansAllowedInBundle; return this; }
<<<<<<< invoiceApi.insertCredit(account.getId(), remainingRequestPayment, clock.getUTCToday(), account.getCurrency(), true, callContext); ======= invoiceApi.insertCredit(account.getId(), remainingRequestPayment, clock.getUTCToday(), account.getCurrency(), "pay all invoices", callContext); >>>>>>> invoiceApi.insertCredit(account.getId(), remainingRequestPayment, clock.getUTCToday(), account.getCurrency(), true, "pay all invoices", callContext);
<<<<<<< import com.ning.billing.entitlement.api.user.ISubscriptionTransition; import com.ning.billing.util.eventbus.IEventBus; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.util.Iterator; import java.util.List; import java.util.Stack; ======= import com.ning.billing.entitlement.api.user.SubscriptionTransition; import com.ning.billing.util.eventbus.EventBus; >>>>>>> import com.ning.billing.entitlement.api.user.SubscriptionTransition; import com.ning.billing.util.eventbus.EventBus; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.util.Iterator; import java.util.List; import java.util.Stack;
<<<<<<< this(paymentAttemptId, invoice.getId(), invoice.getAccountId(), invoice.getAmountOutstanding(), invoice.getCurrency(), invoice.getInvoiceDate(), null, null, null, null); ======= this(paymentAttemptId, invoice.getId(), invoice.getAccountId(), invoice.getBalance(), invoice.getCurrency(), invoice.getInvoiceDate(), null); >>>>>>> this(paymentAttemptId, invoice.getId(), invoice.getAccountId(), invoice.getBalance(), invoice.getCurrency(), invoice.getInvoiceDate(), null, null, null, null);
<<<<<<< private final OverdueAccessApi overdueApi; private final CatalogService catalogService; ======= >>>>>>> private final CatalogService catalogService; <<<<<<< final AddonUtils addonUtils, final NotificationQueueService notificationQueueService, final CustomFieldDao customFieldDao, final OverdueAccessApi overdueApi, final CatalogService catalogService) { ======= final AddonUtils addonUtils, final NotificationQueueService notificationQueueService, final CustomFieldDao customFieldDao) { >>>>>>> final AddonUtils addonUtils, final NotificationQueueService notificationQueueService, final CustomFieldDao customFieldDao, final CatalogService catalogService) {
<<<<<<< import javax.ws.rs.WebApplicationException; ======= import javax.annotation.Nullable; >>>>>>> import javax.annotation.Nullable; import javax.ws.rs.WebApplicationException;
<<<<<<< import com.ning.billing.util.callcontext.CallOrigin; ======= import com.ning.billing.util.Hostname; import com.ning.billing.util.config.NotificationConfig; >>>>>>> import com.ning.billing.util.Hostname; import com.ning.billing.util.config.NotificationConfig; <<<<<<< import com.google.common.collect.ImmutableList; public class DefaultNotificationQueue extends NotificationQueueBase { ======= import com.fasterxml.jackson.databind.ObjectMapper; public class DefaultNotificationQueue implements NotificationQueue { >>>>>>> import com.fasterxml.jackson.databind.ObjectMapper; import com.google.common.collect.ImmutableList; public class DefaultNotificationQueue implements NotificationQueue { <<<<<<< public DefaultNotificationQueue(final IDBI dbi, final Clock clock, final String svcName, final String queueName, final NotificationQueueHandler handler, final NotificationConfig config, final InternalCallContextFactory internalCallContextFactory) { super(clock, svcName, queueName, handler, config); this.dbi = dbi; ======= private final NotificationQueueService notificationQueueService; private volatile boolean isStarted; public DefaultNotificationQueue(final String svcName, final String queueName, final NotificationQueueHandler handler, final IDBI dbi, final NotificationQueueService notificationQueueService) { this.svcName = svcName; this.queueName = queueName; this.handler = handler; >>>>>>> private final NotificationQueueService notificationQueueService; private volatile boolean isStarted; public DefaultNotificationQueue(final String svcName, final String queueName, final NotificationQueueHandler handler, final IDBI dbi, final NotificationQueueService notificationQueueService) { this.svcName = svcName; this.queueName = queueName; this.handler = handler; this.dbi = dbi; <<<<<<< @Override public int doProcessEvents() { logDebug("ENTER doProcessEvents"); // Finding and claiming notifications is not done per tenant (yet?) final List<Notification> notifications = getReadyNotifications(createCallContext(null, null, null)); if (notifications.size() == 0) { logDebug("EXIT doProcessEvents"); return 0; } logDebug("START processing %d events at time %s", notifications.size(), getClock().getUTCNow().toDate()); int result = 0; for (final Notification cur : notifications) { getNbProcessedEvents().incrementAndGet(); logDebug("handling notification %s, key = %s for time %s", cur.getId(), cur.getNotificationKey(), cur.getEffectiveDate()); final NotificationKey key = deserializeEvent(cur.getNotificationKeyClass(), cur.getNotificationKey()); getHandler().handleReadyNotification(key, cur.getEffectiveDate(), cur.getFutureUserToken(), cur.getAccountRecordId(), cur.getTenantRecordId()); result++; clearNotification(cur, createCallContext(cur.getUserToken(), cur.getTenantRecordId(), cur.getAccountRecordId())); logDebug("done handling notification %s, key = %s for time %s", cur.getId(), cur.getNotificationKey(), cur.getEffectiveDate()); } return result; } ======= >>>>>>> <<<<<<< // Create a new user token. This will be used in the future, when this notification is triggered, to trace // generated bus events final UUID futureUserToken = UUID.randomUUID(); final Notification notification = new DefaultNotification(getFullQName(), getHostname(), notificationKey.getClass().getName(), json, context.getUserToken(), futureUserToken, futureNotificationTime, context.getAccountRecordId(), context.getTenantRecordId()); ======= final Notification notification = new DefaultNotification(getFullQName(), hostname, notificationKey.getClass().getName(), json, accountId, futureNotificationTime, context.getAccountRecordId(), context.getTenantRecordId()); >>>>>>> final UUID futureUserToken = UUID.randomUUID(); final Notification notification = new DefaultNotification(getFullQName(), hostname, notificationKey.getClass().getName(), json, context.getUserToken(), futureUserToken, futureNotificationTime, context.getAccountRecordId(), context.getTenantRecordId()); <<<<<<< private InternalCallContext createCallContext(final UUID userToken, @Nullable final Long tenantRecordId, @Nullable final Long accountRecordId) { return internalCallContextFactory.createInternalCallContext(tenantRecordId, accountRecordId, "NotificationQueue", CallOrigin.INTERNAL, UserType.SYSTEM, userToken); ======= @Override public String getFullQName() { return NotificationQueueServiceBase.getCompositeName(svcName, queueName); } @Override public String getServiceName() { return svcName; >>>>>>> @Override public String getFullQName() { return NotificationQueueServiceBase.getCompositeName(svcName, queueName); } @Override public String getServiceName() { return svcName;
<<<<<<< import com.ning.billing.entitlement.api.SubscriptionTransitionType; ======= import com.ning.billing.catalog.api.PriceList; >>>>>>> import com.ning.billing.entitlement.api.SubscriptionTransitionType; import com.ning.billing.catalog.api.PriceList;
<<<<<<< import org.killbill.billing.account.api.Account; import org.killbill.billing.callcontext.InternalTenantContext; import org.killbill.billing.catalog.api.Currency; ======= >>>>>>> import org.killbill.billing.callcontext.InternalTenantContext; <<<<<<< import org.killbill.billing.util.callcontext.CallContext; import org.killbill.billing.util.callcontext.InternalCallContextFactory; import org.killbill.billing.util.config.definition.PaymentConfig; import org.slf4j.Logger; import org.slf4j.LoggerFactory; ======= import org.killbill.billing.util.config.PaymentConfig; >>>>>>> import org.killbill.billing.util.callcontext.CallContext; import org.killbill.billing.util.callcontext.InternalCallContextFactory; import org.killbill.billing.util.config.definition.PaymentConfig; <<<<<<< private static final Logger log = LoggerFactory.getLogger(DefaultApiBase.class); private static final Joiner JOINER = Joiner.on(","); protected final PaymentConfig paymentConfig; protected final InternalCallContextFactory internalCallContextFactory; ======= private final PaymentConfig paymentConfig; >>>>>>> private final PaymentConfig paymentConfig; protected final InternalCallContextFactory internalCallContextFactory; <<<<<<< protected void logAPICall(final String transactionType, final Account account, final UUID paymentMethodId, @Nullable final UUID paymentId, @Nullable final UUID transactionId, @Nullable final BigDecimal amount, @Nullable final Currency currency, @Nullable final String paymentExternalKey, @Nullable final String paymentTransactionExternalKey, @Nullable final TransactionStatus transactionStatus, @Nullable final List<String> paymentControlPluginNames) { if (log.isInfoEnabled()) { final StringBuilder logLine = new StringBuilder(); logLine.append("PaymentApi: transactionType='") .append(transactionType) .append("', accountId='") .append(account.getId()) .append("'"); if (paymentMethodId != null) { logLine.append(", paymentMethodId='") .append(paymentMethodId) .append("'"); } if (paymentExternalKey != null) { logLine.append(", paymentExternalKey='") .append(paymentExternalKey) .append("'"); } if (paymentTransactionExternalKey != null) { logLine.append(", paymentTransactionExternalKey='") .append(paymentTransactionExternalKey) .append("'"); } if (paymentId != null) { logLine.append(", paymentId='") .append(paymentId) .append("'"); } if (transactionId != null) { logLine.append(", transactionId='") .append(transactionId) .append("'"); } if (amount != null) { logLine.append(", amount='") .append(amount) .append("'"); } if (currency != null) { logLine.append(", currency='") .append(currency) .append("'"); } if (transactionStatus != null) { logLine.append(", transactionStatus='") .append(transactionStatus) .append("'"); } if (paymentControlPluginNames != null) { logLine.append(", paymentControlPluginNames='") .append(JOINER.join(paymentControlPluginNames)) .append("'"); } log.info(logLine.toString()); } } protected List<String> toPaymentControlPluginNames(final PaymentOptions paymentOptions, final CallContext callContext) { final InternalTenantContext internalTenantContext = internalCallContextFactory.createInternalTenantContextWithoutAccountRecordId(callContext); ======= protected List<String> toPaymentControlPluginNames(final PaymentOptions paymentOptions) { >>>>>>> protected List<String> toPaymentControlPluginNames(final PaymentOptions paymentOptions, final CallContext callContext) { final InternalTenantContext internalTenantContext = internalCallContextFactory.createInternalTenantContextWithoutAccountRecordId(callContext);
<<<<<<< public void subscriptionCreated(final SubscriptionEvent created) throws AccountApiException ======= public void subscriptionCreated(final SubscriptionEventTransition created) throws AccountApiException, EntitlementUserApiException >>>>>>> public void subscriptionCreated(final SubscriptionEvent created) throws AccountApiException, EntitlementUserApiException <<<<<<< public void subscriptionRecreated(final SubscriptionEvent recreated) throws AccountApiException ======= public void subscriptionRecreated(final SubscriptionEventTransition recreated) throws AccountApiException, EntitlementUserApiException >>>>>>> public void subscriptionRecreated(final SubscriptionEvent recreated) throws AccountApiException, EntitlementUserApiException <<<<<<< public void subscriptionCancelled(final SubscriptionEvent cancelled) throws AccountApiException ======= public void subscriptionCancelled(final SubscriptionEventTransition cancelled) throws AccountApiException, EntitlementUserApiException >>>>>>> public void subscriptionCancelled(final SubscriptionEvent cancelled) throws AccountApiException, EntitlementUserApiException <<<<<<< public void subscriptionChanged(final SubscriptionEvent changed) throws AccountApiException ======= public void subscriptionChanged(final SubscriptionEventTransition changed) throws AccountApiException, EntitlementUserApiException >>>>>>> public void subscriptionChanged(final SubscriptionEvent changed) throws AccountApiException, EntitlementUserApiException <<<<<<< public void subscriptionPhaseChanged(final SubscriptionEvent phaseChanged) throws AccountApiException ======= public void subscriptionPhaseChanged(final SubscriptionEventTransition phaseChanged) throws AccountApiException, EntitlementUserApiException >>>>>>> public void subscriptionPhaseChanged(final SubscriptionEvent phaseChanged) throws AccountApiException, EntitlementUserApiException <<<<<<< public void recordTransition(final BusinessSubscriptionEvent event, final SubscriptionEvent transition) throws AccountApiException ======= public void recordTransition(final BusinessSubscriptionEvent event, final SubscriptionEventTransition transition) throws AccountApiException, EntitlementUserApiException >>>>>>> public void recordTransition(final BusinessSubscriptionEvent event, final SubscriptionEvent transition) throws AccountApiException, EntitlementUserApiException
<<<<<<< public interface Account extends AccountData, CustomizableEntity, UpdatableEntity, Taggable, Overdueable { public DateTime getCreatedDate(); public DateTime getUpdatedDate(); public MutableAccountData toMutableAccountData(); ======= >>>>>>>
<<<<<<< // For ADD_ON we can provide externalKey or the bundleId final boolean createAddOnEntitlement = ProductCategory.ADD_ON.toString().equals(subscription.getProductCategory()); if (createAddOnEntitlement) { Preconditions.checkArgument(subscription.getExternalKey() != null || subscription.getBundleId() != null, "SubscriptionJson bundleId or externalKey should be specified for ADD_ON"); ======= // For ADD_ON we need to provide externalKey or the bundleId if (ProductCategory.ADD_ON.toString().equals(entitlement.getProductCategory())) { Preconditions.checkArgument(entitlement.getExternalKey() != null || entitlement.getBundleId() != null, "SubscriptionJson bundleId or externalKey should be specified for ADD_ON"); >>>>>>> // For ADD_ON we need to provide externalKey or the bundleId if (ProductCategory.ADD_ON.toString().equals(subscription.getProductCategory())) { Preconditions.checkArgument(subscription.getExternalKey() != null || subscription.getBundleId() != null, "SubscriptionJson bundleId or externalKey should be specified for ADD_ON"); <<<<<<< final List<PlanPhasePriceOverride> overrides = PhasePriceOverrideJson.toPlanPhasePriceOverrides(subscription.getPriceOverrides(), spec, account.getCurrency()); final Entitlement result = createAddOnEntitlement ? entitlementApi.addEntitlement(getBundleIdForAddOnCreation(subscription), spec, overrides, resolvedEntitlementDate, resolvedBillingDate, isMigrated, pluginProperties, callContext) : entitlementApi.createBaseEntitlement(account.getId(), spec, subscription.getExternalKey(), overrides, resolvedEntitlementDate, resolvedBillingDate, isMigrated, renameKeyIfExistsAndUnused, pluginProperties, callContext); ======= final List<PlanPhasePriceOverride> overrides = PhasePriceOverrideJson.toPlanPhasePriceOverrides(entitlement.getPriceOverrides(), spec, account.getCurrency()); final Entitlement result = isInitialBundle ? entitlementApi.createBaseEntitlement(account.getId(), spec, entitlement.getExternalKey(), overrides, resolvedEntitlementDate, resolvedBillingDate, isMigrated, renameKeyIfExistsAndUnused, pluginProperties, callContext) : entitlementApi.addEntitlement(getBundleIdForAddOnCreation(entitlement), spec, overrides, resolvedEntitlementDate, resolvedBillingDate, isMigrated, pluginProperties, callContext); >>>>>>> final List<PlanPhasePriceOverride> overrides = PhasePriceOverrideJson.toPlanPhasePriceOverrides(subscription.getPriceOverrides(), spec, account.getCurrency()); final Entitlement result = isInitialBundle ? entitlementApi.createBaseEntitlement(account.getId(), spec, subscription.getExternalKey(), overrides, resolvedEntitlementDate, resolvedBillingDate, isMigrated, renameKeyIfExistsAndUnused, pluginProperties, callContext) : entitlementApi.addEntitlement(getBundleIdForAddOnCreation(subscription), spec, overrides, resolvedEntitlementDate, resolvedBillingDate, isMigrated, pluginProperties, callContext);
<<<<<<< /* Repair */ ENT_REPAIR_INVALID_DELETE_SET(1091, "Event %s is not deleted for subscription %s but prior events were"), ENT_REPAIR_NON_EXISTENT_DELETE_EVENT(1092, "Event %s does not exist for subscription %s"), ENT_REPAIR_MISSING_AO_DELETE_EVENT(1093, "Event %s should be in deleted set for subscription %s because BP events got deleted earlier"), ENT_REPAIR_NEW_EVENT_BEFORE_LAST_BP_REMAINING(1094, "New event %s for subscription %s is before last remaining event for BP"), ENT_REPAIR_NEW_EVENT_BEFORE_LAST_AO_REMAINING(1095, "New event %s for subscription %s is before last remaining event"), ENT_REPAIR_UNKNOWN_TYPE(1096, "Unknown new event type %s for subscription %s"), ENT_REPAIR_UNKNOWN_BUNDLE(1097, "Unknown bundle %s"), ENT_REPAIR_UNKNOWN_SUBSCRIPTION(1098, "Unknown subscription %s"), ENT_REPAIR_NO_ACTIVE_SUBSCRIPTIONS(1099, "No active subscriptions on bundle %s"), ENT_REPAIR_VIEW_CHANGED(1100, "View for bundle %s has changed from %s to %s"), ENT_REPAIR_SUB_RECREATE_NOT_EMPTY(1101, "Subscription %s with recreation for bundle %s should specify all existing events to be deleted"), ENT_REPAIR_SUB_EMPTY(1102, "Subscription %s with recreation for bundle %s should specify all existing events to be deleted"), ENT_REPAIR_BP_RECREATE_MISSING_AO(1103, "BP recreation for bundle %s implies repair all subscriptions"), ENT_REPAIR_BP_RECREATE_MISSING_AO_CREATE(1104, "BP recreation for bundle %s implies that all AO should be start also with a CREATE"), ENT_REPAIR_AO_CREATE_BEFORE_BP_START(1105, "Can't recreate AO %s for bundle %s before BP starts"), ======= ENT_BUNDLE_IS_OVERDUE_BLOCKED(1090, "Changes to this bundle are blocked by overdue enforcement (%s : %s)"), ENT_ACCOUNT_IS_OVERDUE_BLOCKED(1091, "Changes to this account are blocked by overdue enforcement (%s)"), >>>>>>> /* Repair */ ENT_REPAIR_INVALID_DELETE_SET(1091, "Event %s is not deleted for subscription %s but prior events were"), ENT_REPAIR_NON_EXISTENT_DELETE_EVENT(1092, "Event %s does not exist for subscription %s"), ENT_REPAIR_MISSING_AO_DELETE_EVENT(1093, "Event %s should be in deleted set for subscription %s because BP events got deleted earlier"), ENT_REPAIR_NEW_EVENT_BEFORE_LAST_BP_REMAINING(1094, "New event %s for subscription %s is before last remaining event for BP"), ENT_REPAIR_NEW_EVENT_BEFORE_LAST_AO_REMAINING(1095, "New event %s for subscription %s is before last remaining event"), ENT_REPAIR_UNKNOWN_TYPE(1096, "Unknown new event type %s for subscription %s"), ENT_REPAIR_UNKNOWN_BUNDLE(1097, "Unknown bundle %s"), ENT_REPAIR_UNKNOWN_SUBSCRIPTION(1098, "Unknown subscription %s"), ENT_REPAIR_NO_ACTIVE_SUBSCRIPTIONS(1099, "No active subscriptions on bundle %s"), ENT_REPAIR_VIEW_CHANGED(1100, "View for bundle %s has changed from %s to %s"), ENT_REPAIR_SUB_RECREATE_NOT_EMPTY(1101, "Subscription %s with recreation for bundle %s should specify all existing events to be deleted"), ENT_REPAIR_SUB_EMPTY(1102, "Subscription %s with recreation for bundle %s should specify all existing events to be deleted"), ENT_REPAIR_BP_RECREATE_MISSING_AO(1103, "BP recreation for bundle %s implies repair all subscriptions"), ENT_REPAIR_BP_RECREATE_MISSING_AO_CREATE(1104, "BP recreation for bundle %s implies that all AO should be start also with a CREATE"), ENT_REPAIR_AO_CREATE_BEFORE_BP_START(1105, "Can't recreate AO %s for bundle %s before BP starts"), ENT_BUNDLE_IS_OVERDUE_BLOCKED(1090, "Changes to this bundle are blocked by overdue enforcement (%s : %s)"), ENT_ACCOUNT_IS_OVERDUE_BLOCKED(1091, "Changes to this account are blocked by overdue enforcement (%s)"),
<<<<<<< import static javax.ws.rs.core.MediaType.APPLICATION_JSON; import java.util.ArrayList; import java.util.Collection; import java.util.List; import java.util.UUID; ======= >>>>>>>
<<<<<<< private final BooleanSettingDefinition mulitLanguageDefinition = createMultiLanguageDefinition(); private boolean multiLanguageDatasource = true; ======= >>>>>>> private final BooleanSettingDefinition mulitLanguageDefinition = createMultiLanguageDefinition(); private boolean multiLanguageDatasource = true;
<<<<<<< @Override public List<SubscriptionTransition> getAllTransitions() { if (transitions == null) { return Collections.emptyList(); } List<SubscriptionTransition> result = new ArrayList<SubscriptionTransition>(); for (SubscriptionTransition cur : transitions) { result.add(cur); } return result; } ======= @Override public SubscriptionTransition getPendingTransition() { if (transitions == null) { return null; } for (SubscriptionTransition cur : transitions) { if (cur.getEffectiveTransitionTime().isAfter(clock.getUTCNow())) { return cur; } } return null; } >>>>>>> @Override public List<SubscriptionTransition> getAllTransitions() { if (transitions == null) { return Collections.emptyList(); } List<SubscriptionTransition> result = new ArrayList<SubscriptionTransition>(); for (SubscriptionTransition cur : transitions) { result.add(cur); } return result; } public SubscriptionTransition getPendingTransition() { if (transitions == null) { return null; } for (SubscriptionTransition cur : transitions) { if (cur.getEffectiveTransitionTime().isAfter(clock.getUTCNow())) { return cur; } } return null; }
<<<<<<< import com.ning.billing.catalog.api.*; import com.ning.billing.entitlement.api.user.Subscription; ======= import com.ning.billing.ErrorCode; import com.ning.billing.catalog.api.CatalogApiException; import com.ning.billing.catalog.api.Catalog; import com.ning.billing.catalog.api.CatalogService; import com.ning.billing.catalog.api.Duration; import com.ning.billing.catalog.api.Plan; import com.ning.billing.catalog.api.PlanPhase; import com.ning.billing.catalog.api.PhaseType; import com.ning.billing.catalog.api.PlanAlignmentChange; import com.ning.billing.catalog.api.PlanAlignmentCreate; import com.ning.billing.catalog.api.PlanPhaseSpecifier; import com.ning.billing.catalog.api.PlanSpecifier; import com.ning.billing.entitlement.api.user.EntitlementUserApiException; import com.ning.billing.entitlement.api.user.SubscriptionData; >>>>>>> import com.ning.billing.ErrorCode; import com.ning.billing.catalog.api.*; import com.ning.billing.entitlement.api.user.EntitlementUserApiException; import com.ning.billing.entitlement.api.user.SubscriptionData; <<<<<<< import com.ning.billing.util.clock.Clock; import org.joda.time.DateTime; import java.util.Collections; import java.util.LinkedList; import java.util.List; ======= import com.ning.billing.util.clock.DefaultClock; >>>>>>> import com.ning.billing.util.clock.DefaultClock; import org.joda.time.DateTime; import java.util.Collections; import java.util.LinkedList; import java.util.List;
<<<<<<< import com.ning.billing.jaxrs.json.PaymentJsonSimple; ======= import com.ning.billing.jaxrs.json.InvoiceJsonWithItems; >>>>>>> import com.ning.billing.jaxrs.json.InvoiceJsonWithItems; import com.ning.billing.jaxrs.json.PaymentJsonSimple; <<<<<<< import com.ning.billing.payment.api.Payment; import com.ning.billing.payment.api.PaymentApi; import com.ning.billing.payment.api.PaymentApiException; ======= import com.ning.billing.jaxrs.util.TagHelper; import com.ning.billing.util.api.CustomFieldUserApi; import com.ning.billing.util.api.TagUserApi; import com.ning.billing.util.dao.ObjectType; >>>>>>> import com.ning.billing.jaxrs.util.TagHelper; import com.ning.billing.payment.api.Payment; import com.ning.billing.payment.api.PaymentApi; import com.ning.billing.payment.api.PaymentApiException; import com.ning.billing.util.api.CustomFieldUserApi; import com.ning.billing.util.api.TagUserApi; import com.ning.billing.util.dao.ObjectType;
<<<<<<< final Payment payment = paymentApi.getPayment(invoiceUserApi.getInvoicesByAccount(account.getId(), false, callContext).get(1).getPayments().get(0).getPaymentId(), false, PLUGIN_PROPERTIES, callContext); ======= final Payment payment = paymentApi.getPayment(invoiceUserApi.getInvoicesByAccount(account.getId(), callContext).get(1).getPayments().get(0).getPaymentId(), false, false, PLUGIN_PROPERTIES, callContext); >>>>>>> final Payment payment = paymentApi.getPayment(invoiceUserApi.getInvoicesByAccount(account.getId(), false, callContext).get(1).getPayments().get(0).getPaymentId(), false, false, PLUGIN_PROPERTIES, callContext); <<<<<<< final InvoicePayment invoicePayment = invoicePaymentApi.getInvoicePayments(invoiceUserApi.getInvoicesByAccount(account.getId(), false, callContext).get(1).getPayments().get(0).getPaymentId(), callContext).get(0); Payment payment = paymentApi.getPayment(invoicePayment.getPaymentId(), false, ImmutableList.<PluginProperty>of(), callContext); payment = createChargeBackAndCheckForCompletion(account, payment, NextEvent.PAYMENT, NextEvent.INVOICE_PAYMENT, NextEvent.BLOCK); ======= final InvoicePayment invoicePayment = invoicePaymentApi.getInvoicePayments(invoiceUserApi.getInvoicesByAccount(account.getId(), callContext).get(1).getPayments().get(0).getPaymentId(), callContext).get(0); final Payment payment = paymentApi.getPayment(invoicePayment.getPaymentId(), false, false, ImmutableList.<PluginProperty>of(), callContext); createChargeBackAndCheckForCompletion(account, payment, NextEvent.PAYMENT, NextEvent.INVOICE_PAYMENT, NextEvent.BLOCK); >>>>>>> final InvoicePayment invoicePayment = invoicePaymentApi.getInvoicePayments(invoiceUserApi.getInvoicesByAccount(account.getId(), false, callContext).get(1).getPayments().get(0).getPaymentId(), callContext).get(0); Payment payment = paymentApi.getPayment(invoicePayment.getPaymentId(), false, false, ImmutableList.<PluginProperty>of(), callContext); payment = createChargeBackAndCheckForCompletion(account, payment, NextEvent.PAYMENT, NextEvent.INVOICE_PAYMENT, NextEvent.BLOCK);
<<<<<<< @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 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(); } public void notifyOfPaymentInit(final InvoicePaymentModelDao invoicePayment, final InternalCallContext context) { synchronized (monitor) { payments.put(invoicePayment.getId(), invoicePayment); } }
<<<<<<< protected ContiguousIntervalCapacityUsageInArrear createContiguousIntervalCapacityInArrear(final DefaultUsage usage, final List<RawUsageRecord> rawUsages, final LocalDate targetDate, final boolean closedInterval, UsageDetailMode detailMode, final BillingEvent... events) { final ContiguousIntervalCapacityUsageInArrear intervalCapacityInArrear = new ContiguousIntervalCapacityUsageInArrear(usage, accountId, invoiceId, rawUsages, EMPTY_EXISTING_TRACKING_IDS, targetDate, new LocalDate(events[0].getEffectiveDate()), detailMode, internalCallContext); ======= protected ContiguousIntervalCapacityUsageInArrear createContiguousIntervalCapacityInArrear(final DefaultUsage usage, final List<RawUsage> rawUsages, final LocalDate targetDate, final boolean closedInterval, UsageDetailMode detailMode, final BillingEvent... events) { final ContiguousIntervalCapacityUsageInArrear intervalCapacityInArrear = new ContiguousIntervalCapacityUsageInArrear(usage, accountId, invoiceId, rawUsages, EMPTY_EXISTING_TRACKING_IDS, targetDate, new LocalDate(events[0].getEffectiveDate()), detailMode, invoiceConfig, internalCallContext); >>>>>>> protected ContiguousIntervalCapacityUsageInArrear createContiguousIntervalCapacityInArrear(final DefaultUsage usage, final List<RawUsageRecord> rawUsages, final LocalDate targetDate, final boolean closedInterval, UsageDetailMode detailMode, final BillingEvent... events) { final ContiguousIntervalCapacityUsageInArrear intervalCapacityInArrear = new ContiguousIntervalCapacityUsageInArrear(usage, accountId, invoiceId, rawUsages, EMPTY_EXISTING_TRACKING_IDS, targetDate, new LocalDate(events[0].getEffectiveDate()), detailMode, invoiceConfig, internalCallContext); <<<<<<< protected ContiguousIntervalConsumableUsageInArrear createContiguousIntervalConsumableInArrear(final DefaultUsage usage, final List<RawUsageRecord> rawUsages, final LocalDate targetDate, final boolean closedInterval, UsageDetailMode detailMode, final BillingEvent... events) { final ContiguousIntervalConsumableUsageInArrear intervalConsumableInArrear = new ContiguousIntervalConsumableUsageInArrear(usage, accountId, invoiceId, rawUsages, EMPTY_EXISTING_TRACKING_IDS, targetDate, new LocalDate(events[0].getEffectiveDate()), detailMode, internalCallContext); ======= protected ContiguousIntervalConsumableUsageInArrear createContiguousIntervalConsumableInArrear(final DefaultUsage usage, final List<RawUsage> rawUsages, final LocalDate targetDate, final boolean closedInterval, UsageDetailMode detailMode, final BillingEvent... events) { final ContiguousIntervalConsumableUsageInArrear intervalConsumableInArrear = new ContiguousIntervalConsumableUsageInArrear(usage, accountId, invoiceId, rawUsages, EMPTY_EXISTING_TRACKING_IDS, targetDate, new LocalDate(events[0].getEffectiveDate()), detailMode, invoiceConfig, internalCallContext); >>>>>>> protected ContiguousIntervalConsumableUsageInArrear createContiguousIntervalConsumableInArrear(final DefaultUsage usage, final List<RawUsageRecord> rawUsages, final LocalDate targetDate, final boolean closedInterval, UsageDetailMode detailMode, final BillingEvent... events) { final ContiguousIntervalConsumableUsageInArrear intervalConsumableInArrear = new ContiguousIntervalConsumableUsageInArrear(usage, accountId, invoiceId, rawUsages, EMPTY_EXISTING_TRACKING_IDS, targetDate, new LocalDate(events[0].getEffectiveDate()), detailMode, invoiceConfig, internalCallContext);
<<<<<<< import org.joda.time.DateTime; import org.joda.time.Seconds; import org.skife.jdbi.v2.Handle; ======= import org.skife.jdbi.v2.Handle; >>>>>>> import org.joda.time.DateTime; import org.joda.time.Seconds; import org.skife.jdbi.v2.Handle; <<<<<<< ======= import org.skife.jdbi.v2.Transaction; import org.skife.jdbi.v2.TransactionStatus; import org.skife.jdbi.v2.tweak.HandleCallback; >>>>>>> import org.skife.jdbi.v2.tweak.HandleCallback; <<<<<<< import com.ning.billing.util.clock.MockClockModule; ======= import com.ning.billing.util.clock.Clock; >>>>>>> <<<<<<< ======= @Inject private MysqlTestingHelper helper; @Inject >>>>>>> @Inject private MysqlTestingHelper helper; @Inject <<<<<<< private TagDefinition tag1; private TagDefinition tag2; private TagStoreModuleMock module; private TagSqlDao tagSqlDao; ======= @Inject private TagStoreSqlDao tagStoreSqlDao; @Inject >>>>>>> @Inject private TagSqlDao tagSqlDao; @Inject <<<<<<< ControlTag paymentTag = new DefaultControlTag(ControlTagType.AUTO_BILLING_OFF); ======= ControlTag paymentTag = new DefaultControlTag("testUser", clock.getUTCNow(), ControlTagType.AUTO_PAY_OFF); >>>>>>> ControlTag paymentTag = new DefaultControlTag(ControlTagType.AUTO_PAY_OFF); <<<<<<< String definitionName = ControlTagType.AUTO_BILLING_OFF.toString(); tagDefinitionDao.create(definitionName, "This should break", context); ======= String definitionName = ControlTagType.AUTO_PAY_OFF.toString(); tagDefinitionDao.create(definitionName, "This should break", "test"); >>>>>>> String definitionName = ControlTagType.AUTO_PAY_OFF.toString(); tagDefinitionDao.create(definitionName, "This should break", context);
<<<<<<< ======= @JsonView(BundleTimelineViews.ReadTimeline.class) >>>>>>> <<<<<<< public AccountTimelineJson(Account account, List<Invoice> invoices, List<Payment> payments, List<BundleTimeline> bundles) { ======= public AccountTimelineJson(final Account account, final List<Invoice> invoices, final List<PaymentAttempt> payments, final List<BundleTimeline> bundles) { >>>>>>> public AccountTimelineJson(final Account account, final List<Invoice> invoices, final List<Payment> payments, final List<BundleTimeline> bundles) { <<<<<<< this.payments = new LinkedList<PaymentJsonWithBundleKeys>(); for (Payment cur : payments) { String status = cur.getPaymentStatus().toString(); BigDecimal paidAmount = cur.getPaymentStatus() == PaymentStatus.SUCCESS ? cur.getAmount() : BigDecimal.ZERO; this.payments.add(new PaymentJsonWithBundleKeys(cur.getAmount(), paidAmount, account.getId().toString(), cur.getInvoiceId().toString(), cur.getId().toString(), cur.getEffectiveDate(), cur.getEffectiveDate(), cur.getAttempts().size(), cur.getCurrency().toString(), status, getBundleExternalKey(cur.getInvoiceId(), invoices, bundles))); } ======= this.payments = new LinkedList<PaymentJsonWithBundleKeys>(); for (final PaymentAttempt cur : payments) { final String status = cur.getPaymentId() != null ? "Success" : "Failed"; final BigDecimal paidAmount = cur.getPaymentId() != null ? cur.getAmount() : BigDecimal.ZERO; this.payments.add(new PaymentJsonWithBundleKeys(cur.getAmount(), paidAmount, cur.getInvoiceId(), cur.getPaymentId(), cur.getCreatedDate(), cur.getUpdatedDate(), cur.getRetryCount(), cur.getCurrency().toString(), status, cur.getAccountId(), getBundleExternalKey(cur.getInvoiceId(), invoices, bundles))); } >>>>>>> this.payments = new LinkedList<PaymentJsonWithBundleKeys>(); for (Payment cur : payments) { String status = cur.getPaymentStatus().toString(); BigDecimal paidAmount = cur.getPaymentStatus() == PaymentStatus.SUCCESS ? cur.getAmount() : BigDecimal.ZERO; this.payments.add(new PaymentJsonWithBundleKeys(cur.getAmount(), paidAmount, account.getId().toString(), cur.getInvoiceId().toString(), cur.getId().toString(), cur.getEffectiveDate(), cur.getEffectiveDate(), cur.getAttempts().size(), cur.getCurrency().toString(), status, getBundleExternalKey(cur.getInvoiceId(), invoices, bundles))); }
<<<<<<< public PaymentAttempt createPaymentAttempt(Invoice invoice, PaymentAttemptStatus paymentAttemptStatus, CallContext context) { PaymentAttempt updatedPaymentAttempt = new PaymentAttempt(UUID.randomUUID(), invoice.getId(), invoice.getAccountId(), ======= public PaymentAttempt createPaymentAttempt(Invoice invoice, CallContext context) { PaymentAttempt updatedPaymentAttempt = new DefaultPaymentAttempt(UUID.randomUUID(), invoice.getId(), invoice.getAccountId(), >>>>>>> public PaymentAttempt createPaymentAttempt(Invoice invoice, PaymentAttemptStatus paymentAttemptStatus, CallContext context) { PaymentAttempt updatedPaymentAttempt = new DefaultPaymentAttempt(UUID.randomUUID(), invoice.getId(), invoice.getAccountId(), <<<<<<< paymentAttemptStatus, context.getCreatedDate(), context.getUpdatedDate()); ======= paymentAttempt.getCreatedDate(), paymentAttempt.getUpdatedDate()); >>>>>>> context.getCreatedDate(), context.getUpdatedDate(), paymentAttemptStatus);
<<<<<<< ======= import com.ning.billing.junction.api.Blockable.Type; import com.ning.billing.junction.api.BlockingApi; >>>>>>> import com.ning.billing.junction.api.Blockable.Type; <<<<<<< import com.ning.billing.util.svcapi.junction.BlockingApi; ======= import com.ning.billing.util.dao.ObjectType; >>>>>>> import com.ning.billing.util.dao.ObjectType; import com.ning.billing.util.svcapi.junction.BlockingApi;
<<<<<<< public boolean apply(final RawUsageRecord input) { return input.getSubscriptionId().equals(subscriptionBillingEvents.get(0).getSubscription().getId()); ======= public boolean apply(final RawUsage input) { return input.getSubscriptionId().equals(subscriptionBillingEvents.get(0).getSubscriptionId()); >>>>>>> public boolean apply(final RawUsageRecord input) { return input.getSubscriptionId().equals(subscriptionBillingEvents.get(0).getSubscriptionId());
<<<<<<< ======= import com.ning.billing.account.api.Account; import org.joda.time.DateTime; import java.util.List; >>>>>>> import java.util.List; <<<<<<< import org.joda.time.DateTime; ======= >>>>>>> import org.joda.time.DateTime; import com.ning.billing.account.api.Account; <<<<<<< * @param accountId * @return an ordered list of billing events for the given account ======= * @return the list of accounts which have active subscriptions */ public List<Account> getActiveAccounts(); /** * * @param subscriptionId the subscriptionId of interest for a gievn account * @return an ordered list of billing event >>>>>>> * @param accountId * @return an ordered list of billing events for the given account * @return the list of accounts which have active subscriptions */ public List<Account> getActiveAccounts(); /** * * @param subscriptionId the subscriptionId of interest for a gievn account * @return an ordered list of billing event
<<<<<<< import com.ning.billing.config.IEntitlementConfig; import com.ning.billing.entitlement.alignment.IPlanAligner; import com.ning.billing.entitlement.alignment.IPlanAligner.TimedPhase; import com.ning.billing.entitlement.api.IEntitlementService; ======= import com.ning.billing.catalog.api.CatalogApiException; import com.ning.billing.config.EntitlementConfig; import com.ning.billing.entitlement.alignment.PlanAligner; import com.ning.billing.entitlement.alignment.TimedPhase; import com.ning.billing.entitlement.api.EntitlementService; import com.ning.billing.entitlement.api.billing.DefaultEntitlementBillingApi; >>>>>>> import com.ning.billing.config.EntitlementConfig; import com.ning.billing.entitlement.alignment.PlanAligner; import com.ning.billing.entitlement.alignment.TimedPhase; import com.ning.billing.entitlement.api.EntitlementService; import com.ning.billing.entitlement.api.billing.DefaultEntitlementBillingApi; <<<<<<< import com.ning.billing.lifecycle.LyfecycleHandlerType; import com.ning.billing.lifecycle.LyfecycleHandlerType.LyfecycleLevel; import com.ning.billing.util.clock.IClock; import com.ning.billing.util.eventbus.IEventBus; import com.ning.billing.util.eventbus.IEventBus.EventBusException; import org.joda.time.DateTime; import org.slf4j.Logger; import org.slf4j.LoggerFactory; ======= import com.ning.billing.lifecycle.LifecycleHandlerType; import com.ning.billing.lifecycle.LifecycleHandlerType.LifecycleLevel; import com.ning.billing.util.clock.Clock; import com.ning.billing.util.eventbus.EventBus; import com.ning.billing.util.eventbus.EventBus.EventBusException; import com.sun.org.apache.xml.internal.resolver.CatalogException; >>>>>>> import com.ning.billing.lifecycle.LifecycleHandlerType; import com.ning.billing.lifecycle.LifecycleHandlerType.LifecycleLevel; import com.ning.billing.util.clock.Clock; import com.ning.billing.util.eventbus.EventBus; import com.ning.billing.util.eventbus.EventBus.EventBusException; import org.joda.time.DateTime; import org.slf4j.Logger; import org.slf4j.LoggerFactory;
<<<<<<< @ApiModel(value="Credit", parent = JsonBase.class) ======= @ApiModel(value = "Credit") >>>>>>> @ApiModel(value="Credit", parent = JsonBase.class) <<<<<<< private final Currency currency; ======= private final String itemDetails; private final String currency; >>>>>>> private final Currency currency; private final String itemDetails; <<<<<<< public Currency getCurrency() { ======= public String getItemDetails() { return itemDetails; } public String getCurrency() { >>>>>>> public Currency getCurrency() {
<<<<<<< import java.util.Iterator; ======= import java.util.LinkedList; >>>>>>> import java.util.Iterator; import java.util.LinkedList; <<<<<<< private ArrayList<SubscriptionBundle> bundles; private ArrayList<Subscription> subscriptions; private ArrayList<SubscriptionEventTransition> transitions; private EntitlementUserApi entitlementApi; private BlockingCalculator blockCalculator = new BlockingCalculator(null) { @Override public void insertBlockingEvents(SortedSet<BillingEvent> billingEvents) { } }; ======= private List<SubscriptionBundle> bundles; private List<Subscription> subscriptions; private List<SubscriptionEventTransition> subscriptionTransitions; private EntitlementUserApi entitlementApi; >>>>>>> private List<SubscriptionBundle> bundles; private List<Subscription> subscriptions; private List<SubscriptionEventTransition> subscriptionTransitions; private EntitlementUserApi entitlementApi; private BlockingCalculator blockCalculator = new BlockingCalculator(null) { @Override public void insertBlockingEvents(SortedSet<BillingEvent> billingEvents) { } }; <<<<<<< eventId, subId, bunId, EventType.API_USER, ApiEventType.CREATE, then, now, null, null, null, null, SubscriptionState.ACTIVE, nextPlan, nextPhase, nextPriceList, 1, null, true); transitions.add(t); ======= zeroId, oneId, twoId, EventType.API_USER, ApiEventType.CREATE, then, now, null, null, null, null, SubscriptionState.ACTIVE, nextPlan, nextPhase, nextPriceList, 1, null, true); subscriptionTransitions.add(t); >>>>>>> eventId, subId, bunId, EventType.API_USER, ApiEventType.CREATE, then, now, null, null, null, null, SubscriptionState.ACTIVE, nextPlan, nextPhase, nextPriceList, 1, null, true); subscriptionTransitions.add(t); <<<<<<< eventId, subId, bunId, EventType.API_USER, ApiEventType.CREATE, then, now, null, null, null, null, SubscriptionState.ACTIVE, nextPlan, nextPhase, nextPriceList, 1, null, true); transitions.add(t); ======= zeroId, oneId, twoId, EventType.API_USER, ApiEventType.CREATE, then, now, null, null, null, null, SubscriptionState.ACTIVE, nextPlan, nextPhase, nextPriceList, 1, null, true); subscriptionTransitions.add(t); >>>>>>> eventId, subId, bunId, EventType.API_USER, ApiEventType.CREATE, then, now, null, null, null, null, SubscriptionState.ACTIVE, nextPlan, nextPhase, nextPriceList, 1, null, true); subscriptionTransitions.add(t); <<<<<<< eventId, subId, bunId, EventType.API_USER, ApiEventType.CREATE, then, now, null, null, null, null, SubscriptionState.ACTIVE, nextPlan, nextPhase, nextPriceList, 1, null, true); transitions.add(t); ======= zeroId, oneId, twoId, EventType.API_USER, ApiEventType.CREATE, then, now, null, null, null, null, SubscriptionState.ACTIVE, nextPlan, nextPhase, nextPriceList, 1, null, true); subscriptionTransitions.add(t); >>>>>>> eventId, subId, bunId, EventType.API_USER, ApiEventType.CREATE, then, now, null, null, null, null, SubscriptionState.ACTIVE, nextPlan, nextPhase, nextPriceList, 1, null, true); subscriptionTransitions.add(t); <<<<<<< eventId, subId, bunId, EventType.API_USER, ApiEventType.CREATE, then, now, null, null, null, null, SubscriptionState.ACTIVE, nextPlan, nextPhase, nextPriceList, 1, null, true); transitions.add(t); ======= zeroId, oneId, twoId, EventType.API_USER, ApiEventType.CREATE, then, now, null, null, null, null, SubscriptionState.ACTIVE, nextPlan, nextPhase, nextPriceList, 1, null, true); subscriptionTransitions.add(t); >>>>>>> eventId, subId, bunId, EventType.API_USER, ApiEventType.CREATE, then, now, null, null, null, null, SubscriptionState.ACTIVE, nextPlan, nextPhase, nextPriceList, 1, null, true); subscriptionTransitions.add(t);
<<<<<<< final List<InvoiceItem> newProposedItems = processRecurringEvent(invoiceId, accountId, thisEvent, adjustedNextEvent, targetDate, currency, logStringBuilder, events.getRecurringBillingMode(), perSubscriptionFutureNotificationDate, existingInvoices, internalCallContext); ======= final List<InvoiceItem> newProposedItems = processRecurringEvent(invoiceId, accountId, thisEvent, adjustedNextEvent, targetDate, currency, logStringBuilder, events.getRecurringBillingMode(), perSubscriptionFutureNotificationDate, events.getAccountDateAndTimeZoneContext()); >>>>>>> final List<InvoiceItem> newProposedItems = processRecurringEvent(invoiceId, accountId, thisEvent, adjustedNextEvent, targetDate, currency, logStringBuilder, events.getRecurringBillingMode(), perSubscriptionFutureNotificationDate, internalCallContext); <<<<<<< final List<InvoiceItem> newProposedItems = processRecurringEvent(invoiceId, accountId, nextEvent, null, targetDate, currency, logStringBuilder, events.getRecurringBillingMode(), perSubscriptionFutureNotificationDate, existingInvoices, internalCallContext); ======= final List<InvoiceItem> newProposedItems = processRecurringEvent(invoiceId, accountId, nextEvent, null, targetDate, currency, logStringBuilder, events.getRecurringBillingMode(), perSubscriptionFutureNotificationDate, events.getAccountDateAndTimeZoneContext()); >>>>>>> final List<InvoiceItem> newProposedItems = processRecurringEvent(invoiceId, accountId, nextEvent, null, targetDate, currency, logStringBuilder, events.getRecurringBillingMode(), perSubscriptionFutureNotificationDate, internalCallContext); <<<<<<< @Nullable final List<Invoice> existingInvoices, final InternalCallContext internalCallContext) throws InvoiceApiException { ======= final AccountDateAndTimeZoneContext dateAndTimeZoneContext) throws InvoiceApiException { >>>>>>> final InternalCallContext internalCallContext) throws InvoiceApiException { <<<<<<< private LocalDate computeMaxEndDateForFixedTermPlanPhase(final BillingEvent thisEvent, @Nullable final List<Invoice> existingInvoices) { if (existingInvoices == null || existingInvoices.isEmpty()) { return null; } LocalDate firstStartDate = null; for (int i = existingInvoices.size() - 1; i >= 0; i--) { final Invoice cur = existingInvoices.get(i); final InvoiceItem matchItem = Iterables.tryFind(cur.getInvoiceItems(), new Predicate<InvoiceItem>() { @Override public boolean apply(final InvoiceItem input) { return input.getInvoiceItemType() == InvoiceItemType.RECURRING && thisEvent.getSubscription().getId().equals(input.getSubscriptionId()) && thisEvent.getPlanPhase().getName().equals(input.getPhaseName()); } }).orNull(); if (matchItem == null) { break; } firstStartDate = matchItem.getStartDate(); } return firstStartDate != null ? thisEvent.getPlanPhase().getDuration().addToLocalDate(firstStartDate) : null; ======= private LocalDate computeMaxEndDateForFixedTermPlanPhase(final BillingEvent thisEvent, final AccountDateAndTimeZoneContext dateAndTimeZoneContext) { final LocalDate eventEffectiveDate = dateAndTimeZoneContext.computeLocalDateFromFixedAccountOffset(thisEvent.getEffectiveDate()); return addDurationToLocalDate(eventEffectiveDate, thisEvent.getPlanPhase().getDuration()); >>>>>>> private LocalDate computeMaxEndDateForFixedTermPlanPhase(final BillingEvent thisEvent, final InternalCallContext callContext) { final LocalDate eventEffectiveDate = callContext.toLocalDate(thisEvent.getEffectiveDate()); return thisEvent.getPlanPhase().getDuration().addToLocalDate(eventEffectiveDate);
<<<<<<< ======= import com.ning.billing.payment.setup.PaymentConfig; import com.ning.billing.util.callcontext.CallContext; >>>>>>> import com.ning.billing.util.callcontext.CallContext; <<<<<<< // TODO: send a notification that invoice was ignored? log.info("Received invoice for payment with balance of 0 {} ", invoice); Either<PaymentErrorEvent, PaymentInfoEvent> result = Either.left((PaymentErrorEvent) new DefaultPaymentError("invoice_balance_0", "Invoice balance was 0 or less", account.getId(), UUID.fromString(invoiceId), context.getUserToken())); processedPaymentsOrErrors.add(result); ======= log.debug("Received invoice for payment with balance of 0 {} ", invoice); >>>>>>> log.debug("Received invoice for payment with balance of 0 {} ", invoice); <<<<<<< public List<Either<PaymentErrorEvent, PaymentInfoEvent>> createRefund(Account account, List<String> invoiceIds, CallContext context) { //TODO throw new UnsupportedOperationException(); ======= public List<Either<PaymentError, PaymentInfo>> createRefund(Account account, List<String> invoiceIds, CallContext context) { final PaymentProviderPlugin plugin = getPaymentProviderPlugin(account); return plugin.processRefund(account); >>>>>>> public List<Either<PaymentErrorEvent, PaymentInfoEvent>> createRefund(Account account, List<String> invoiceIds, CallContext context) { final PaymentProviderPlugin plugin = getPaymentProviderPlugin(account); return plugin.processRefund(account);
<<<<<<< ======= import com.ning.billing.catalog.api.Currency; import com.ning.billing.util.ChangeType; import com.ning.billing.util.audit.dao.AuditSqlDao; import com.ning.billing.util.callcontext.CallContext; import com.ning.billing.util.callcontext.CallOrigin; import com.ning.billing.util.callcontext.UserType; import com.ning.billing.util.callcontext.CallContextFactory; >>>>>>> import com.ning.billing.catalog.api.Currency; import com.ning.billing.util.ChangeType; import com.ning.billing.util.audit.dao.AuditSqlDao; import com.ning.billing.util.callcontext.CallContext; import com.ning.billing.util.callcontext.CallOrigin; import com.ning.billing.util.callcontext.UserType; import com.ning.billing.util.callcontext.CallContextFactory; <<<<<<< private final BillCycleDayCalculator bcdCalculator; ======= private final CatalogService catalogService; private final SubscriptionFactory subscriptionFactory; private static final String SUBSCRIPTION_TABLE_NAME = "subscriptions"; >>>>>>> private final BillCycleDayCalculator bcdCalculator; private final SubscriptionFactory subscriptionFactory; private static final String SUBSCRIPTION_TABLE_NAME = "subscriptions"; <<<<<<< public DefaultEntitlementBillingApi(final CallContextFactory factory, final EntitlementDao dao, final AccountUserApi accountApi, final BillCycleDayCalculator bcdCalculator) { ======= public DefaultEntitlementBillingApi(final CallContextFactory factory, final SubscriptionFactory subscriptionFactory, final EntitlementDao dao, final AccountUserApi accountApi, final CatalogService catalogService) { >>>>>>> public DefaultEntitlementBillingApi(final CallContextFactory factory, final SubscriptionFactory subscriptionFactory, final EntitlementDao dao, final AccountUserApi accountApi, final BillCycleDayCalculator bcdCalculator) { <<<<<<< List<Subscription> subscriptions = entitlementDao.getSubscriptions(bundle.getId()); ======= List<Subscription> subscriptions = entitlementDao.getSubscriptions(subscriptionFactory, bundle.getId()); >>>>>>> List<Subscription> subscriptions = entitlementDao.getSubscriptions(subscriptionFactory, bundle.getId());
<<<<<<< import com.ning.billing.util.entity.EntityBase; import org.joda.time.DateTime; ======= import com.ning.billing.util.clock.Clock; >>>>>>> import com.ning.billing.util.entity.EntityBase; <<<<<<< // used to hydrate invoice from persistence layer public DefaultInvoice(UUID invoiceId, UUID accountId, @Nullable Integer invoiceNumber, DateTime invoiceDate, DateTime targetDate, Currency currency, @Nullable String createdBy, @Nullable DateTime createdDate) { super(invoiceId, createdBy, createdDate); ======= public DefaultInvoice(UUID accountId, DateTime targetDate, Currency currency, Clock clock, boolean migrationInvoice) { this(UUID.randomUUID(), accountId, null, clock.getUTCNow(), targetDate, currency, migrationInvoice); } public DefaultInvoice(UUID invoiceId, UUID accountId, @Nullable Integer invoiceNumber, DateTime invoiceDate, DateTime targetDate, Currency currency) { this(invoiceId, accountId, invoiceNumber, invoiceDate, targetDate, currency, false); } public DefaultInvoice(UUID invoiceId, UUID accountId, @Nullable Integer invoiceNumber,DateTime invoiceDate, DateTime targetDate, Currency currency, boolean migrationInvoice) { this.id = invoiceId; >>>>>>> // used to hydrate invoice from persistence layer public DefaultInvoice(UUID invoiceId, UUID accountId, @Nullable Integer invoiceNumber, DateTime invoiceDate, DateTime targetDate, Currency currency, boolean isMigrationInvoice, @Nullable String createdBy, @Nullable DateTime createdDate) { super(invoiceId, createdBy, createdDate);
<<<<<<< crappyWaitForLackOfProperSynchonization(); Assert.assertEquals(accountApi.getOverdueAccount(accountJson.getAccountId(), requestOptions).getName(), "OD1"); ======= callbackServlet.assertListenerStatus(); Assert.assertEquals(killBillClient.getOverdueStateForAccount(accountJson.getAccountId(), requestOptions).getName(), "OD1"); >>>>>>> callbackServlet.assertListenerStatus(); Assert.assertEquals(accountApi.getOverdueAccount(accountJson.getAccountId(), requestOptions).getName(), "OD1"); <<<<<<< crappyWaitForLackOfProperSynchonization(); Assert.assertEquals(accountApi.getOverdueAccount(accountJson.getAccountId(), requestOptions).getName(), "OD2"); ======= callbackServlet.assertListenerStatus(); Assert.assertEquals(killBillClient.getOverdueStateForAccount(accountJson.getAccountId(), requestOptions).getName(), "OD2"); >>>>>>> callbackServlet.assertListenerStatus(); Assert.assertEquals(accountApi.getOverdueAccount(accountJson.getAccountId(), requestOptions).getName(), "OD2"); <<<<<<< crappyWaitForLackOfProperSynchonization(); Assert.assertEquals(accountApi.getOverdueAccount(accountJson.getAccountId(), requestOptions).getName(), "OD3"); ======= callbackServlet.assertListenerStatus(); Assert.assertEquals(killBillClient.getOverdueStateForAccount(accountJson.getAccountId(), requestOptions).getName(), "OD3"); >>>>>>> callbackServlet.assertListenerStatus(); Assert.assertEquals(accountApi.getOverdueAccount(accountJson.getAccountId(), requestOptions).getName(), "OD3");
<<<<<<< PriceList nextPriceList = catalogService.getFullCatalog().findPriceList(PriceListSet.DEFAULT_PRICELIST_NAME, now); SubscriptionTransition t = new SubscriptionTransitionData( zeroId, oneId, twoId, EventType.API_USER, ApiEventType.CREATE, then, now, null, null, null, null, SubscriptionState.ACTIVE, nextPlan, nextPhase, nextPriceList, 1, true); ======= String nextPriceList = PriceListSet.DEFAULT_PRICELIST_NAME; SubscriptionEventTransition t = new SubscriptionTransitionData( zeroId, oneId, twoId, EventType.API_USER, ApiEventType.CREATE, then, now, null, null, null, null, SubscriptionState.ACTIVE, nextPlan, nextPhase, nextPriceList, 1, null, true); >>>>>>> PriceList nextPriceList = catalogService.getFullCatalog().findPriceList(PriceListSet.DEFAULT_PRICELIST_NAME, now); SubscriptionEventTransition t = new SubscriptionTransitionData( zeroId, oneId, twoId, EventType.API_USER, ApiEventType.CREATE, then, now, null, null, null, null, SubscriptionState.ACTIVE, nextPlan, nextPhase, nextPriceList, 1, null, true); <<<<<<< PriceList nextPriceList = catalogService.getFullCatalog().findPriceList(PriceListSet.DEFAULT_PRICELIST_NAME, now); SubscriptionTransition t = new SubscriptionTransitionData( zeroId, oneId, twoId, EventType.API_USER, ApiEventType.CREATE, then, now, null, null, null, null, SubscriptionState.ACTIVE, nextPlan, nextPhase, nextPriceList, 1, true); ======= String nextPriceList = PriceListSet.DEFAULT_PRICELIST_NAME; SubscriptionEventTransition t = new SubscriptionTransitionData( zeroId, oneId, twoId, EventType.API_USER, ApiEventType.CREATE, then, now, null, null, null, null, SubscriptionState.ACTIVE, nextPlan, nextPhase, nextPriceList, 1, null, true); >>>>>>> PriceList nextPriceList = catalogService.getFullCatalog().findPriceList(PriceListSet.DEFAULT_PRICELIST_NAME, now); SubscriptionEventTransition t = new SubscriptionTransitionData( zeroId, oneId, twoId, EventType.API_USER, ApiEventType.CREATE, then, now, null, null, null, null, SubscriptionState.ACTIVE, nextPlan, nextPhase, nextPriceList, 1, null, true); <<<<<<< PriceList nextPriceList = catalogService.getFullCatalog().findPriceList(PriceListSet.DEFAULT_PRICELIST_NAME, now); SubscriptionTransition t = new SubscriptionTransitionData( zeroId, oneId, twoId, EventType.API_USER, ApiEventType.CREATE, then, now, null, null, null, null, SubscriptionState.ACTIVE, nextPlan, nextPhase, nextPriceList, 1, true); ======= String nextPriceList = PriceListSet.DEFAULT_PRICELIST_NAME; SubscriptionEventTransition t = new SubscriptionTransitionData( zeroId, oneId, twoId, EventType.API_USER, ApiEventType.CREATE, then, now, null, null, null, null, SubscriptionState.ACTIVE, nextPlan, nextPhase, nextPriceList, 1, null, true); >>>>>>> PriceList nextPriceList = catalogService.getFullCatalog().findPriceList(PriceListSet.DEFAULT_PRICELIST_NAME, now); SubscriptionEventTransition t = new SubscriptionTransitionData( zeroId, oneId, twoId, EventType.API_USER, ApiEventType.CREATE, then, now, null, null, null, null, SubscriptionState.ACTIVE, nextPlan, nextPhase, nextPriceList, 1, null, true); <<<<<<< PriceList nextPriceList = catalogService.getFullCatalog().findPriceList(PriceListSet.DEFAULT_PRICELIST_NAME, now); SubscriptionTransition t = new SubscriptionTransitionData( zeroId, oneId, twoId, EventType.API_USER, ApiEventType.CREATE, then, now, null, null, null, null, SubscriptionState.ACTIVE, nextPlan, nextPhase, nextPriceList, 1, true); ======= String nextPriceList = PriceListSet.DEFAULT_PRICELIST_NAME; SubscriptionEventTransition t = new SubscriptionTransitionData( zeroId, oneId, twoId, EventType.API_USER, ApiEventType.CREATE, then, now, null, null, null, null, SubscriptionState.ACTIVE, nextPlan, nextPhase, nextPriceList, 1, null, true); >>>>>>> PriceList nextPriceList = catalogService.getFullCatalog().findPriceList(PriceListSet.DEFAULT_PRICELIST_NAME, now); SubscriptionEventTransition t = new SubscriptionTransitionData( zeroId, oneId, twoId, EventType.API_USER, ApiEventType.CREATE, then, now, null, null, null, null, SubscriptionState.ACTIVE, nextPlan, nextPhase, nextPriceList, 1, null, true);
<<<<<<< protected final List<TransitionTime> transitionTimes; ======= protected final List<TransitionTime> transitionTimes; >>>>>>> protected final List<TransitionTime> transitionTimes; <<<<<<< ======= // Ordering is important here! protected final LinkedHashMap<BillingEvent, Set<String>> allSeenUnitTypes; >>>>>>> // Ordering is important here! protected final LinkedHashMap<BillingEvent, Set<String>> allSeenUnitTypes; <<<<<<< final RawUsageRecord curRawUsage = rawUsageIterator.next(); if (curRawUsage.getDate().compareTo(transitionTimes.get(0).getDate()) >= 0) { ======= final RawUsage curRawUsage = rawUsageIterator.next(); if (curRawUsage.getDate().compareTo(transitionTimes.get(0).getDate()) >= 0) { >>>>>>> final RawUsageRecord curRawUsage = rawUsageIterator.next(); if (curRawUsage.getDate().compareTo(transitionTimes.get(0).getDate()) >= 0) { <<<<<<< DateTime prevCatalogEffectiveDate = null; for (final TransitionTime curTransition : transitionTimes) { ======= for (final TransitionTime curTransition : transitionTimes) { >>>>>>> DateTime prevCatalogEffectiveDate = null; for (final TransitionTime curTransition : transitionTimes) { <<<<<<< result.add(new DefaultRolledUpUsageWithMetadata(getSubscriptionId(), prevDate, curDate, rolledUpUnits, prevCatalogEffectiveDate)); ======= result.add(new DefaultRolledUpUsage(getSubscriptionId(), prevDate, curDate, rolledUpUnits)); >>>>>>> result.add(new DefaultRolledUpUsageWithMetadata(getSubscriptionId(), prevDate, curDate, rolledUpUnits, prevCatalogEffectiveDate)); <<<<<<< private List<RolledUpUsageWithMetadata> getEmptyRolledUpUsage() { final List<RolledUpUsageWithMetadata> result = new ArrayList<RolledUpUsageWithMetadata>(); final TransitionTime initialTransition = transitionTimes.get(transitionTimes.size() - 2); final TransitionTime endTransition = transitionTimes.get(transitionTimes.size() - 1); final LocalDate startDate = initialTransition.getDate(); final LocalDate endDate = endTransition.getDate(); ======= private List<RolledUpUsage> getEmptyRolledUpUsage() { final List<RolledUpUsage> result = new ArrayList<RolledUpUsage>(); final TransitionTime initialTransition = transitionTimes.get(transitionTimes.size() - 2); final TransitionTime endTransition = transitionTimes.get(transitionTimes.size() - 1); final LocalDate startDate = initialTransition.getDate(); final LocalDate endDate = endTransition.getDate(); >>>>>>> private List<RolledUpUsageWithMetadata> getEmptyRolledUpUsage() { final List<RolledUpUsageWithMetadata> result = new ArrayList<RolledUpUsageWithMetadata>(); final TransitionTime initialTransition = transitionTimes.get(transitionTimes.size() - 2); final TransitionTime endTransition = transitionTimes.get(transitionTimes.size() - 1); final LocalDate startDate = initialTransition.getDate(); final LocalDate endDate = endTransition.getDate(); <<<<<<< private List<RawUsageRecord> filterInputRawUsage(final List<RawUsageRecord> rawSubscriptionUsage) { final Iterable<RawUsageRecord> filteredList = Iterables.filter(rawSubscriptionUsage, new Predicate<RawUsageRecord>() { @Override public boolean apply(final RawUsageRecord input) { return unitTypes.contains(input.getUnitType()); } }); return ImmutableList.copyOf(filteredList); } ======= >>>>>>> <<<<<<< protected String toJson(final Object usageInArrearAggregate) { try { return objectMapper.writeValueAsString(usageInArrearAggregate); } catch (JsonProcessingException e) { Preconditions.checkState(false, e.getMessage()); return null; } } ======= public Set<String> getUnitTypes() { return unitTypes; } public class UsageInArrearItemsAndNextNotificationDate { >>>>>>> protected String toJson(final Object usageInArrearAggregate) { try { return objectMapper.writeValueAsString(usageInArrearAggregate); } catch (JsonProcessingException e) { Preconditions.checkState(false, e.getMessage()); return null; } } public Set<String> getUnitTypes() { return unitTypes; }
<<<<<<< ======= import org.killbill.billing.client.model.Account; import org.killbill.billing.client.model.Invoice; import org.killbill.billing.client.model.InvoicePayment; >>>>>>> <<<<<<< import org.killbill.billing.client.model.gen.Account; import org.killbill.billing.client.model.gen.Invoice; import org.killbill.billing.client.model.gen.InvoicePayment; ======= import org.killbill.billing.notification.plugin.api.ExtBusEventType; >>>>>>> import org.killbill.billing.client.model.gen.Account; import org.killbill.billing.client.model.gen.Invoice; import org.killbill.billing.client.model.gen.InvoicePayment; import org.killbill.billing.notification.plugin.api.ExtBusEventType;
<<<<<<< ======= SubscriptionJsonNoEvents json = new SubscriptionJsonNoEvents(subscription); return Response.status(Status.OK).entity(json).build(); >>>>>>>
<<<<<<< import org.skife.config.ConfigurationObjectFactory; ======= import org.skife.config.ConfigurationObjectFactory; >>>>>>> import org.skife.config.ConfigurationObjectFactory; <<<<<<< import com.ning.billing.config.InvoiceConfig; ======= import com.ning.billing.config.InvoiceConfig; import com.ning.billing.invoice.InvoiceListener; import com.ning.billing.invoice.api.DefaultInvoiceService; >>>>>>> import com.ning.billing.config.InvoiceConfig; import com.ning.billing.invoice.InvoiceListener; import com.ning.billing.invoice.api.DefaultInvoiceService; <<<<<<< import com.ning.billing.invoice.api.InvoiceUserApi; ======= import com.ning.billing.invoice.api.InvoiceService; >>>>>>> import com.ning.billing.invoice.api.InvoiceService; import com.ning.billing.invoice.api.InvoiceUserApi; <<<<<<< import com.ning.billing.invoice.notification.DefaultNextBillingDateNotifier; import com.ning.billing.invoice.notification.NextBillingDateNotifier; import com.ning.billing.util.clock.Clock; import com.ning.billing.util.clock.DefaultClock; import com.ning.billing.util.notificationq.DefaultNotificationQueueService; import com.ning.billing.util.notificationq.NotificationQueueService; ======= import com.ning.billing.invoice.model.DefaultInvoiceGenerator; import com.ning.billing.invoice.model.InvoiceGenerator; import com.ning.billing.invoice.notification.DefaultNextBillingDateNotifier; import com.ning.billing.invoice.notification.NextBillingDateNotifier; >>>>>>> import com.ning.billing.invoice.model.DefaultInvoiceGenerator; import com.ning.billing.invoice.model.InvoiceGenerator; import com.ning.billing.invoice.notification.DefaultNextBillingDateNotifier; import com.ning.billing.invoice.notification.NextBillingDateNotifier; <<<<<<< protected void installInvoiceDao() { ======= private void installInvoiceDao() { >>>>>>> protected void installInvoiceDao() { <<<<<<< protected void installNextBillingDateNotification() { final InvoiceConfig config = new ConfigurationObjectFactory(System.getProperties()).build(InvoiceConfig.class); bind(InvoiceConfig.class).toInstance(config); bind(Clock.class).to(DefaultClock.class).asEagerSingleton(); bind(NotificationQueueService.class).to(DefaultNotificationQueueService.class).asEagerSingleton(); bind(NextBillingDateNotifier.class).to(DefaultNextBillingDateNotifier.class).asEagerSingleton(); } ======= protected void installConfig() { final InvoiceConfig config = new ConfigurationObjectFactory(System.getProperties()).build(InvoiceConfig.class); bind(InvoiceConfig.class).toInstance(config); } >>>>>>> protected void installConfig() { final InvoiceConfig config = new ConfigurationObjectFactory(System.getProperties()).build(InvoiceConfig.class); bind(InvoiceConfig.class).toInstance(config); } <<<<<<< installNextBillingDateNotification(); ======= bind(InvoiceService.class).to(DefaultInvoiceService.class).asEagerSingleton(); bind(NextBillingDateNotifier.class).to(DefaultNextBillingDateNotifier.class).asEagerSingleton(); bind(InvoiceListener.class).asEagerSingleton(); bind(InvoiceGenerator.class).to(DefaultInvoiceGenerator.class).asEagerSingleton(); installConfig(); >>>>>>> bind(InvoiceService.class).to(DefaultInvoiceService.class).asEagerSingleton(); bind(NextBillingDateNotifier.class).to(DefaultNextBillingDateNotifier.class).asEagerSingleton(); bind(InvoiceListener.class).asEagerSingleton(); bind(InvoiceGenerator.class).to(DefaultInvoiceGenerator.class).asEagerSingleton(); installConfig();
<<<<<<< import javax.sql.DataSource; ======= import javax.servlet.http.HttpServlet; >>>>>>> import javax.servlet.http.HttpServlet; import javax.sql.DataSource; <<<<<<< import com.ning.billing.osgi.api.OSGIKillbill; ======= import com.ning.billing.osgi.OSGIServlet; >>>>>>> import com.ning.billing.osgi.OSGIServlet; import com.ning.billing.osgi.api.OSGIKillbill; <<<<<<< bind(OSGIKillbill.class).to(DefaultOSGIKillbill.class).asEagerSingleton(); bind(OSGIDataSourceProvider.class).asEagerSingleton(); bind(DataSource.class).annotatedWith(Names.named(OSGI_NAMED)).toProvider(OSGIDataSourceProvider.class).asEagerSingleton(); ======= installOSGIServlet(); >>>>>>> bind(OSGIKillbill.class).to(DefaultOSGIKillbill.class).asEagerSingleton(); bind(OSGIDataSourceProvider.class).asEagerSingleton(); bind(DataSource.class).annotatedWith(Names.named(OSGI_NAMED)).toProvider(OSGIDataSourceProvider.class).asEagerSingleton();