conflict_resolution
stringlengths 27
16k
|
---|
<<<<<<<
new PreviewPanel(panel.database(), null, panel, panel.getLoadedDatabase().getMetaData(), Globals.prefs
.get(JabRefPreferences.PREVIEW_0), true),
new PreviewPanel(panel.database(), null, panel, panel.getLoadedDatabase().getMetaData(), Globals.prefs
.get(JabRefPreferences.PREVIEW_1), true)};
=======
new PreviewPanel(panel.database(), null, panel, panel.metaData(), Globals.prefs
.get(JabRefPreferences.PREVIEW_0)),
new PreviewPanel(panel.database(), null, panel, panel.metaData(), Globals.prefs
.get(JabRefPreferences.PREVIEW_1))};
>>>>>>>
new PreviewPanel(panel.database(), null, panel, panel.getLoadedDatabase().getMetaData(), Globals.prefs
.get(JabRefPreferences.PREVIEW_0)),
new PreviewPanel(panel.database(), null, panel, panel.getLoadedDatabase().getMetaData(), Globals.prefs
.get(JabRefPreferences.PREVIEW_1))};
<<<<<<<
menu.add(new ExternalFileMenuItem(panel.frame(), entry, content, content,
GUIGlobals.getTableIcon(field).getIcon(), panel.getLoadedDatabase().getMetaData(), field));
=======
Icon icon;
JLabel iconLabel = GUIGlobals.getTableIcon(field);
if (iconLabel == null) {
icon = IconTheme.JabRefIcon.FILE.getIcon();
} else {
icon = iconLabel.getIcon();
}
menu.add(new ExternalFileMenuItem(panel.frame(), entry, content, content, icon,
panel.metaData(), field));
>>>>>>>
Icon icon;
JLabel iconLabel = GUIGlobals.getTableIcon(field);
if (iconLabel == null) {
icon = IconTheme.JabRefIcon.FILE.getIcon();
} else {
icon = iconLabel.getIcon();
}
menu.add(new ExternalFileMenuItem(panel.frame(), entry, content, content, icon,
panel.getLoadedDatabase().getMetaData(), field)); |
<<<<<<<
private static final Log LOGGER = LogFactory.getLog(GroupTreeNodeViewModel.class);
private static final Icon GROUP_REFINING_ICON = IconTheme.JabRefIcons.GROUP_REFINING.getSmallIcon();
private static final Icon GROUP_INCLUDING_ICON = IconTheme.JabRefIcons.GROUP_INCLUDING.getSmallIcon();
=======
private static final Logger LOGGER = LoggerFactory.getLogger(GroupTreeNodeViewModel.class);
private static final Icon GROUP_REFINING_ICON = IconTheme.JabRefIcon.GROUP_REFINING.getSmallIcon();
private static final Icon GROUP_INCLUDING_ICON = IconTheme.JabRefIcon.GROUP_INCLUDING.getSmallIcon();
>>>>>>>
private static final Logger LOGGER = LoggerFactory.getLogger(GroupTreeNodeViewModel.class);
private static final Icon GROUP_REFINING_ICON = IconTheme.JabRefIcons.GROUP_REFINING.getSmallIcon();
private static final Icon GROUP_INCLUDING_ICON = IconTheme.JabRefIcons.GROUP_INCLUDING.getSmallIcon(); |
<<<<<<<
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
=======
import java.awt.event.ActionEvent;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.List;
import java.util.stream.Collectors;
import javax.swing.AbstractAction;
import javax.swing.Action;
import javax.swing.JOptionPane;
import javafx.stage.FileChooser;
>>>>>>>
import java.awt.event.ActionEvent;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.List;
import java.util.stream.Collectors;
import javax.swing.AbstractAction;
import javax.swing.Action;
import javax.swing.JOptionPane;
import javafx.stage.FileChooser;
<<<<<<<
import javax.swing.*;
import javax.swing.filechooser.FileFilter;
import java.awt.event.ActionEvent;
import java.io.File;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.TreeSet;
=======
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
>>>>>>>
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
<<<<<<<
Map<String, ExportFormat> customFormats = Globals.prefs.customExports.getCustomExportFormats(Globals.prefs,
Globals.journalAbbreviationLoader);
LayoutFormatterPreferences layoutPreferences = Globals.prefs
.getLayoutFormatterPreferences(Globals.journalAbbreviationLoader);
SavePreferences savePreferences = SavePreferences.loadForExportFromPreferences(Globals.prefs);
ExportFormats.initAllExports(customFormats, layoutPreferences, savePreferences);
JFileChooser fc = ExportAction
.createExportFileChooser(Globals.prefs.get(JabRefPreferences.EXPORT_WORKING_DIRECTORY));
fc.showSaveDialog(null);
File file = fc.getSelectedFile();
if (file == null) {
return;
}
FileFilter ff = fc.getFileFilter();
if (ff instanceof ExportFileFilter) {
ExportFileFilter eff = (ExportFileFilter) ff;
String path = file.getPath();
if (!path.endsWith(eff.getExtension())) {
path = path + eff.getExtension();
=======
Globals.exportFactory = ExporterFactory.create(Globals.prefs, Globals.journalAbbreviationLoader);
FileDialogConfiguration fileDialogConfiguration = ExportAction.createExportFileChooser(Globals.exportFactory, Globals.prefs.get(JabRefPreferences.EXPORT_WORKING_DIRECTORY));
DialogService dialogService = new FXDialogService();
DefaultTaskExecutor.runInJavaFXThread(() ->
dialogService.showFileSaveDialog(fileDialogConfiguration)
.ifPresent(path -> export(path, fileDialogConfiguration.getSelectedExtensionFilter(), Globals.exportFactory.getExporters())));
}
private void export(Path file, FileChooser.ExtensionFilter selectedExtensionFilter, List<Exporter> exporters) {
String selectedExtension = selectedExtensionFilter.getExtensions().get(0).replace("*", "");
if (!file.endsWith(selectedExtension)) {
FileUtil.addExtension(file, selectedExtension);
>>>>>>>
Globals.exportFactory = ExporterFactory.create(Globals.prefs, Globals.journalAbbreviationLoader);
FileDialogConfiguration fileDialogConfiguration = ExportAction.createExportFileChooser(Globals.exportFactory, Globals.prefs.get(JabRefPreferences.EXPORT_WORKING_DIRECTORY));
DialogService dialogService = new FXDialogService();
DefaultTaskExecutor.runInJavaFXThread(() ->
dialogService.showFileSaveDialog(fileDialogConfiguration)
.ifPresent(path -> export(path, fileDialogConfiguration.getSelectedExtensionFilter(), Globals.exportFactory.getExporters())));
}
private void export(Path file, FileChooser.ExtensionFilter selectedExtensionFilter, List<Exporter> exporters) {
String selectedExtension = selectedExtensionFilter.getExtensions().get(0).replace("*", "");
if (!file.endsWith(selectedExtension)) {
FileUtil.addExtension(file, selectedExtension);
<<<<<<<
if (JOptionPane.showConfirmDialog(null,
Localization.lang("'%0' exists. Overwrite file?", file.getName()),
=======
if (JOptionPane.showConfirmDialog(frame,
Localization.lang("'%0' exists. Overwrite file?", file.getFileName().toString()),
>>>>>>>
if (JOptionPane.showConfirmDialog(null,
Localization.lang("'%0' exists. Overwrite file?", file.getFileName().toString()), |
<<<<<<<
if (page.contains("Error Page")) {
=======
//if max hits were exceeded, display the warning
if (hits > IEEEXploreFetcher.MAX_FETCH) {
>>>>>>>
//if max hits were exceeded, display the warning
if (hits > IEEEXploreFetcher.MAX_FETCH) {
<<<<<<<
Localization.lang("Intermittent errors on the IEEE Xplore server. Please try again in a while."),
DIALOG_TITLE, JOptionPane.INFORMATION_MESSAGE);
return false;
=======
Localization.lang("%0 entries found. To reduce server load, only %1 will be downloaded.",
String.valueOf(hits), String.valueOf(IEEEXploreFetcher.MAX_FETCH)),
DIALOG_TITLE, JOptionPane.INFORMATION_MESSAGE);
>>>>>>>
Localization.lang("%0 entries found. To reduce server load, only %1 will be downloaded.",
String.valueOf(hits), String.valueOf(IEEEXploreFetcher.MAX_FETCH)),
DIALOG_TITLE, JOptionPane.INFORMATION_MESSAGE);
<<<<<<<
private void parse(ImportInspector dialog, String text) {
BibEntry entry;
while (((entry = parseNextEntry(text)) != null) && shouldContinue) {
if (entry.getField("title") != null) {
dialog.addEntry(entry);
dialog.setProgress(parsed + unparseable, hits);
parsed++;
=======
private String createBibtexQueryURL(JSONObject searchResultsJson) {
//buffer to use for building the URL for fetching the bibtex data from IEEEXplore
StringBuffer bibtexQueryURLStringBuf = new StringBuffer();
bibtexQueryURLStringBuf.append(URL_BIBTEX_START);
//loop over each record and create a comma-separate list of article numbers which will be used to download the raw Bibtex
JSONArray recordsJsonArray = searchResultsJson.getJSONArray("records");
for (int n = 0; n < recordsJsonArray.length(); n++) {
if (!recordsJsonArray.getJSONObject(n).isNull("articleNumber")) {
bibtexQueryURLStringBuf.append(recordsJsonArray.getJSONObject(n).getString("articleNumber") + ",");
>>>>>>>
private String createBibtexQueryURL(JSONObject searchResultsJson) {
//buffer to use for building the URL for fetching the bibtex data from IEEEXplore
StringBuffer bibtexQueryURLStringBuf = new StringBuffer();
bibtexQueryURLStringBuf.append(URL_BIBTEX_START);
//loop over each record and create a comma-separate list of article numbers which will be used to download the raw Bibtex
JSONArray recordsJsonArray = searchResultsJson.getJSONArray("records");
for (int n = 0; n < recordsJsonArray.length(); n++) {
if (!recordsJsonArray.getJSONObject(n).isNull("articleNumber")) {
bibtexQueryURLStringBuf.append(recordsJsonArray.getJSONObject(n).getString("articleNumber") + ",");
<<<<<<<
private BibEntry parseNextEntry(String allText) {
BibEntry entry = null;
int index = allText.indexOf("<div class=\"detail", piv);
int endIndex = allText.indexOf("</div>", index);
if ((index >= 0) && (endIndex > 0)) {
endIndex += 6;
piv = endIndex;
String text = allText.substring(index, endIndex);
EntryType type = null;
String sourceField = null;
String typeName = "";
Matcher typeMatcher = typePattern.matcher(text);
if (typeMatcher.find()) {
typeName = typeMatcher.group(1);
if ("IEEE Journals & Magazines".equalsIgnoreCase(typeName)
|| "IEEE Early Access Articles".equalsIgnoreCase(typeName)
|| "IET Journals & Magazines".equalsIgnoreCase(typeName)
|| "AIP Journals & Magazines".equalsIgnoreCase(typeName)
|| "AVS Journals & Magazines".equalsIgnoreCase(typeName)
|| "IBM Journals & Magazines".equalsIgnoreCase(typeName)
|| "TUP Journals & Magazines".equalsIgnoreCase(typeName)
|| "BIAI Journals & Magazines".equalsIgnoreCase(typeName)
|| "MIT Press Journals".equalsIgnoreCase(typeName)
|| "Alcatel-Lucent Journal".equalsIgnoreCase(typeName)) {
type = EntryTypes.getType("article");
sourceField = "journal";
} else if ("IEEE Conference Publications".equalsIgnoreCase(typeName)
|| "IET Conference Publications".equalsIgnoreCase(typeName)
|| "VDE Conference Publications".equalsIgnoreCase(typeName)) {
type = EntryTypes.getType("inproceedings");
sourceField = "booktitle";
} else if ("IEEE Standards".equalsIgnoreCase(typeName) || "Standards".equalsIgnoreCase(typeName)) {
type = EntryTypes.getType("standard");
sourceField = "number";
} else if ("IEEE eLearning Library Courses".equalsIgnoreCase(typeName)) {
type = EntryTypes.getType("electronic");
sourceField = "note";
} else if ("Wiley-IEEE Press eBook Chapters".equalsIgnoreCase(typeName)
|| "MIT Press eBook Chapters".equalsIgnoreCase(typeName)
|| "IEEE USA Books & eBooks".equalsIgnoreCase(typeName)) {
type = EntryTypes.getType("incollection");
sourceField = "booktitle";
} else if ("Morgan and Claypool eBooks".equalsIgnoreCase(typeName)) {
type = EntryTypes.getType("book");
sourceField = "note";
}
}
if (type == null) {
type = EntryTypes.getType("misc");
sourceField = "note";
IEEEXploreFetcher.LOGGER.warn("Type detection failed. Use MISC instead. Type string: " + text);
unparseable++;
}
entry = new BibEntry(IdGenerator.next(), type);
if ("IEEE Standards".equalsIgnoreCase(typeName)) {
entry.setField("organization", "IEEE");
}
if ("Wiley-IEEE Press eBook Chapters".equalsIgnoreCase(typeName)) {
entry.setField("publisher", "Wiley-IEEE Press");
} else if ("MIT Press eBook Chapters".equalsIgnoreCase(typeName)) {
entry.setField("publisher", "MIT Press");
} else if ("IEEE USA Books & eBooks".equalsIgnoreCase(typeName)) {
entry.setField("publisher", "IEEE USA");
} else if ("Morgan \\& Claypool eBooks".equalsIgnoreCase(typeName)) {
entry.setField("publisher", "Morgan and Claypool");
}
if ("IEEE Early Access Articles".equalsIgnoreCase(typeName)) {
entry.setField("note", "Early Access");
}
Set<String> fields = fieldPatterns.keySet();
for (String field : fields) {
Matcher fieldMatcher = Pattern.compile(fieldPatterns.get(field)).matcher(text);
if (fieldMatcher.find()) {
entry.setField(field, htmlConverter.format(fieldMatcher.group(1)));
if ("title".equals(field) && fieldMatcher.find()) {
String sec_title = htmlConverter.format(fieldMatcher.group(1));
if (entry.getType() == EntryTypes.getStandardType("standard")) {
sec_title = sec_title.replaceAll("IEEE Std ", "");
}
entry.setField(sourceField, sec_title);
}
if ("pages".equals(field) && (fieldMatcher.groupCount() == 2)) {
entry.setField(field, fieldMatcher.group(1) + "-" + fieldMatcher.group(2));
}
}
}
=======
>>>>>>> |
<<<<<<<
private JPanel contentPane;
private JCheckBox checkBoxDoNotShowAgain;
private JCheckBox useDefaultPDFImportStyle;
private JRadioButton radioButtonXmp;
private JRadioButton radioButtonPDFcontent;
private JRadioButton radioButtonNoMeta;
private JRadioButton radioButtononlyAttachPDF;
=======
private final JPanel contentPane;
private final JCheckBox checkBoxDoNotShowAgain;
private final JCheckBox useDefaultPDFImportStyle;
private final JRadioButton radioButtonXmp;
private final JRadioButton radioButtonPDFcontent;
private final JRadioButton radioButtonMrDlib;
private final JRadioButton radioButtonNoMeta;
private final JRadioButton radioButtononlyAttachPDF;
private final JRadioButton radioButtonUpdateEmptyFields;
>>>>>>>
private final JPanel contentPane;
private final JCheckBox checkBoxDoNotShowAgain;
private final JCheckBox useDefaultPDFImportStyle;
private final JRadioButton radioButtonXmp;
private final JRadioButton radioButtonPDFcontent;
private final JRadioButton radioButtonNoMeta;
private final JRadioButton radioButtononlyAttachPDF;
<<<<<<<
if (radioButtonXmp.isSelected())
return XMP;
else if (radioButtonPDFcontent.isSelected())
return CONTENT;
else if (radioButtonNoMeta.isSelected())
return NOMETA;
else if (radioButtononlyAttachPDF.isSelected())
return ONLYATTACH;
else
=======
if (radioButtonXmp.isSelected()) {
return ImportDialog.XMP;
} else if (radioButtonPDFcontent.isSelected()) {
return ImportDialog.CONTENT;
} else if (radioButtonMrDlib.isSelected()) {
return ImportDialog.MRDLIB;
} else if (radioButtonNoMeta.isSelected()) {
return ImportDialog.NOMETA;
} else if (radioButtononlyAttachPDF.isSelected()) {
return ImportDialog.ONLYATTACH;
} else if (radioButtonUpdateEmptyFields.isSelected()) {
return ImportDialog.UPDATEEMPTYFIELDS;
} else {
>>>>>>>
if (radioButtonXmp.isSelected()) {
return ImportDialog.XMP;
} else if (radioButtonPDFcontent.isSelected()) {
return ImportDialog.CONTENT;
} else if (radioButtonNoMeta.isSelected()) {
return ImportDialog.NOMETA;
} else if (radioButtononlyAttachPDF.isSelected()) {
return ImportDialog.ONLYATTACH;
} else { |
<<<<<<<
import org.jabref.gui.SidePaneType;
import org.jabref.gui.autosaveandbackup.AutosaveUIManager;
=======
>>>>>>>
import org.jabref.gui.SidePaneType;
<<<<<<<
=======
import org.jabref.gui.collab.FileUpdatePanel;
import org.jabref.gui.dialogs.AutosaveUIManager;
>>>>>>>
import org.jabref.gui.dialogs.AutosaveUIManager; |
<<<<<<<
import net.sf.jabref.gui.keyboard.KeyBinding;
import net.sf.jabref.model.database.BibtexDatabase;
=======
import net.sf.jabref.model.database.BibDatabase;
>>>>>>>
import net.sf.jabref.gui.keyboard.KeyBinding;
import net.sf.jabref.model.database.BibDatabase; |
<<<<<<<
@Override
public void start(Stage mainStage) throws Exception {
FallbackExceptionHandler.installExceptionHandler();
=======
private static void start(String[] args) {
// Init preferences
>>>>>>>
@Override
public void start(Stage mainStage) throws Exception {
FallbackExceptionHandler.installExceptionHandler();
ensureCorrectJavaVersion();
// Init preferences
<<<<<<<
if (RemoteListenerClient.sendToActiveJabRefInstance(arguments, remotePreferences.getPort())) {
=======
if (new RemoteClient(remotePreferences.getPort()).sendCommandLineArguments(args)) {
>>>>>>>
if (new RemoteClient(remotePreferences.getPort()).sendCommandLineArguments(arguments)) {
<<<<<<<
// Process arguments
ArgumentProcessor argumentProcessor = new ArgumentProcessor(arguments, ArgumentProcessor.Mode.INITIAL_START);
=======
>>>>>>>
// Process arguments
ArgumentProcessor argumentProcessor = new ArgumentProcessor(arguments, ArgumentProcessor.Mode.INITIAL_START);
<<<<<<<
=======
@Override
public void start(Stage mainStage) throws Exception {
Platform.setImplicitExit(false);
SwingUtilities.invokeLater(() -> start(arguments)
);
}
>>>>>>> |
<<<<<<<
import net.sf.jabref.gui.search.matchers.SearchMatcher;
import net.sf.jabref.gui.util.comparator.FirstColumnComparator;
import net.sf.jabref.gui.util.comparator.IconComparator;
import net.sf.jabref.gui.util.comparator.RankingFieldComparator;
import net.sf.jabref.model.EntryTypes;
import net.sf.jabref.bibtex.BibtexSingleField;
import net.sf.jabref.bibtex.comparator.FieldComparator;
=======
import net.sf.jabref.gui.search.HitOrMissComparator;
import net.sf.jabref.gui.search.matchers.SearchMatcher;
import net.sf.jabref.gui.util.comparator.*;
import net.sf.jabref.model.EntryTypes;
>>>>>>>
import net.sf.jabref.gui.search.matchers.SearchMatcher;
import net.sf.jabref.gui.util.comparator.FirstColumnComparator;
import net.sf.jabref.gui.util.comparator.IconComparator;
import net.sf.jabref.gui.util.comparator.RankingFieldComparator;
import net.sf.jabref.model.EntryTypes;
<<<<<<<
import net.sf.jabref.*;
import net.sf.jabref.groups.EntryTableTransferHandler;
import net.sf.jabref.specialfields.SpecialFieldsUtils;
import ca.odell.glazedlists.EventList;
import ca.odell.glazedlists.SortedList;
import ca.odell.glazedlists.event.ListEventListener;
import ca.odell.glazedlists.matchers.Matcher;
import ca.odell.glazedlists.swing.DefaultEventSelectionModel;
import ca.odell.glazedlists.swing.GlazedListsSwing;
import ca.odell.glazedlists.swing.TableComparatorChooser;
=======
>>>>>>>
import javax.swing.*;
import javax.swing.plaf.TableUI;
import javax.swing.table.DefaultTableCellRenderer;
import javax.swing.table.TableCellRenderer;
import javax.swing.table.TableColumnModel;
import java.awt.*;
import java.awt.event.MouseEvent;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.Optional;
<<<<<<<
public MainTable(MainTableFormat tableFormat, MainTableDataModel model, JabRefFrame frame,
BasePanel panel) {
=======
public MainTable(MainTableFormat tableFormat, EventList<BibEntry> list, JabRefFrame frame, BasePanel panel) {
>>>>>>>
public MainTable(MainTableFormat tableFormat, MainTableDataModel model, JabRefFrame frame,
BasePanel panel) {
<<<<<<<
=======
public void refreshSorting() {
sortedForMarking.getReadWriteLock().writeLock().lock();
try {
if (Globals.prefs.getBoolean(JabRefPreferences.FLOAT_MARKED_ENTRIES)) {
sortedForMarking.setComparator(markingComparator);
} else {
sortedForMarking.setComparator(null);
}
} finally {
sortedForMarking.getReadWriteLock().writeLock().unlock();
}
sortedForSearch.getReadWriteLock().writeLock().lock();
try {
sortedForSearch.setComparator(searchComparator);
} finally {
sortedForSearch.getReadWriteLock().writeLock().unlock();
}
sortedForGrouping.getReadWriteLock().writeLock().lock();
try {
sortedForGrouping.setComparator(groupComparator);
} finally {
sortedForGrouping.getReadWriteLock().writeLock().unlock();
}
}
/**
* Adds a sorting rule that floats hits to the top, and causes non-hits to be grayed out:
*/
public void showFloatSearch() {
if(!isFloatSearchActive) {
isFloatSearchActive = true;
searchMatcher = SearchMatcher.INSTANCE;
searchComparator = new HitOrMissComparator(searchMatcher);
refreshSorting();
scrollTo(0);
}
}
/**
* Removes sorting by search results, and graying out of non-hits.
*/
public void stopShowingFloatSearch() {
if(isFloatSearchActive) {
isFloatSearchActive = false;
searchMatcher = null;
searchComparator = null;
refreshSorting();
}
}
public boolean isFloatSearchActive() {
return isFloatSearchActive;
}
/**
* Adds a sorting rule that floats group hits to the top, and causes non-hits to be grayed out:
*/
public void showFloatGrouping() {
isFloatGroupingActive = true;
groupMatcher = GroupMatcher.INSTANCE;
groupComparator = new HitOrMissComparator(groupMatcher);
refreshSorting();
}
/**
* Removes sorting by group, and graying out of non-hits.
*/
public void stopShowingFloatGrouping() {
if(isFloatGroupingActive) {
isFloatGroupingActive = false;
groupMatcher = null;
groupComparator = null;
refreshSorting();
}
}
public EventList<BibEntry> getTableRows() {
return sortedForGrouping;
}
>>>>>>>
<<<<<<<
BibEntry entry = getBibEntry(row);
TypedBibEntry typedEntry = new TypedBibEntry(entry, Optional.of(panel.database()), panel.getBibDatabaseContext().getMode());
=======
BibEntry entry = sortedForGrouping.get(row);
TypedBibEntry typedEntry = new TypedBibEntry(entry, Optional.of(panel.getDatabase()), panel.getBibDatabaseContext().getMode());
>>>>>>>
BibEntry entry = getBibEntry(row);
TypedBibEntry typedEntry = new TypedBibEntry(entry, Optional.of(panel.getDatabase()), panel.getBibDatabaseContext().getMode());
<<<<<<<
public PersistenceTableColumnListener getTableColumnListener() {
return tableColumnListener;
}
=======
>>>>>>>
public PersistenceTableColumnListener getTableColumnListener() {
return tableColumnListener;
} |
<<<<<<<
import net.sf.jabref.Globals;
import net.sf.jabref.JabRefPreferences;
import net.sf.jabref.bibtex.BibtexEntryAssert;
import net.sf.jabref.model.entry.BibEntry;
=======
import net.sf.jabref.Globals;
import net.sf.jabref.JabRefPreferences;
import net.sf.jabref.importer.OutputPrinterToNull;
import net.sf.jabref.logic.bibtex.BibEntryAssert;
import net.sf.jabref.model.entry.BibEntry;
>>>>>>>
import net.sf.jabref.Globals;
import net.sf.jabref.JabRefPreferences;
import net.sf.jabref.bibtex.BibtexEntryAssert;
import net.sf.jabref.model.entry.BibEntry;
import net.sf.jabref.Globals;
import net.sf.jabref.JabRefPreferences;
import net.sf.jabref.importer.OutputPrinterToNull;
import net.sf.jabref.logic.bibtex.BibEntryAssert;
import net.sf.jabref.model.entry.BibEntry;
<<<<<<<
List<BibEntry> result = testImporter.importDatabase(xmlFile, Charset.defaultCharset()).getDatabase().getEntries();
BibtexEntryAssert.assertEquals(MsBibImporterTest.class, bibFileName, result);
=======
try (InputStream is = MsBibImporter.class.getResourceAsStream(xmlFileName)) {
List<BibEntry> result = testImporter.importEntries(is, new OutputPrinterToNull());
BibEntryAssert.assertEquals(MsBibImporterTest.class, bibFileName, result);
}
>>>>>>>
List<BibEntry> result = testImporter.importDatabase(xmlFile, Charset.defaultCharset()).getDatabase().getEntries();
BibEntryAssert.assertEquals(MsBibImporterTest.class, bibFileName, result); |
<<<<<<<
HashMap<String, AbstractAutoCompleter> autoCompleters = new HashMap<String, AbstractAutoCompleter>();
// Hashtable that holds as keys the names of the fields where
// autocomplete is active, and references to the autocompleter objects.
NameFieldAutoCompleter searchCompleter = null;
//AutoCompleteListener searchCompleteListener = null;
=======
private AutoCompleteListener searchCompleteListener = null;
>>>>>>>
private ContentAutoCompleters autoCompleters = null; //= new HashMap<String, AbstractAutoCompleter>();
// Hashtable that holds as keys the names of the fields where
// autocomplete is active, and references to the autocompleter objects.
private NameFieldAutoCompleter searchCompleter = null;
//private AutoCompleteListener searchCompleteListener = null;
<<<<<<<
public void action() {
frame.setSearchBarVisible(true);
frame.getSearchBar().startSearch();
}
});
=======
@Override
public void action() {
//sidePaneManager.togglePanel("search");
sidePaneManager.show("search");
//boolean on = sidePaneManager.isPanelVisible("search");
frame.searchToggle.setSelected(true);
frame.getSearchManager().startSearch();
}
});
>>>>>>>
@Override
public void action() {
frame.setSearchBarVisible(true);
frame.getSearchBar().startSearch();
}
});
<<<<<<<
public void action() {
frame.setSearchBarVisible(true);
frame.getSearchBar().startIncrementalSearch();
}
});
=======
@Override
public void action() {
sidePaneManager.show("search");
frame.searchToggle.setSelected(true);
frame.getSearchManager().startIncrementalSearch();
}
});
>>>>>>>
@Override
public void action() {
frame.setSearchBarVisible(true);
frame.getSearchBar().startIncrementalSearch();
}
});
<<<<<<<
//searchCompleteListener = new AutoCompleteListener(searchCompleter);
//searchCompleteListener.setConsumeEnterKey(false); // So you don't have to press Enter twice
=======
searchCompleteListener = new AutoCompleteListener(searchAutoCompleter);
searchCompleteListener.setConsumeEnterKey(false); // So you don't have to press Enter twice
>>>>>>>
//searchCompleteListener = new AutoCompleteListener(searchAutoCompleter);
//searchCompleteListener.setConsumeEnterKey(false); // So you don't have to press Enter twice |
<<<<<<<
fileNameScrollPane.setViewportView(fileNameComboBox);
=======
fileNameLabel.setForeground(GUIGlobals.ENTRY_EDITOR_LABEL_COLOR);
authorLabel.setForeground(GUIGlobals.ENTRY_EDITOR_LABEL_COLOR);
dateLabel.setForeground(GUIGlobals.ENTRY_EDITOR_LABEL_COLOR);
pageLabel.setForeground(GUIGlobals.ENTRY_EDITOR_LABEL_COLOR);
commentTxtLabel.setForeground(GUIGlobals.ENTRY_EDITOR_LABEL_COLOR);
fileNameScrollPane.setViewportView(filenameArea);
>>>>>>>
fileNameScrollPane.setViewportView(fileNameComboBox);
fileNameLabel.setForeground(GUIGlobals.ENTRY_EDITOR_LABEL_COLOR);
authorLabel.setForeground(GUIGlobals.ENTRY_EDITOR_LABEL_COLOR);
dateLabel.setForeground(GUIGlobals.ENTRY_EDITOR_LABEL_COLOR);
pageLabel.setForeground(GUIGlobals.ENTRY_EDITOR_LABEL_COLOR);
commentTxtLabel.setForeground(GUIGlobals.ENTRY_EDITOR_LABEL_COLOR); |
<<<<<<<
entryEditor = new EntryEditor(this);
entryEditorContainer = setupEntryEditor(entryEditor);
}
private static JFXPanel setupEntryEditor(EntryEditor entryEditor) {
JFXPanel container = OS.LINUX ? new CustomJFXPanel() : new JFXPanel();
DefaultTaskExecutor.runInJavaFXThread(() -> {
container.setScene(new Scene(entryEditor));
});
container.addKeyListener(new KeyAdapter() {
@Override
public void keyPressed(KeyEvent e) {
//We need to consume this event here to prevent the propgation of keybinding events back to the JFrame
Optional<KeyBinding> keyBinding = Globals.getKeyPrefs().mapToKeyBinding(e);
if (keyBinding.isPresent()) {
switch (keyBinding.get()) {
case CUT:
case COPY:
case PASTE:
case DELETE_ENTRY:
case SELECT_ALL:
e.consume();
break;
default:
//do nothing
}
}
}
});
return container;
=======
this.getDatabase().registerListener(new UpdateTimestampListener(Globals.prefs));
>>>>>>>
this.getDatabase().registerListener(new UpdateTimestampListener(Globals.prefs));
entryEditor = new EntryEditor(this);
entryEditorContainer = setupEntryEditor(entryEditor);
}
private static JFXPanel setupEntryEditor(EntryEditor entryEditor) {
JFXPanel container = OS.LINUX ? new CustomJFXPanel() : new JFXPanel();
DefaultTaskExecutor.runInJavaFXThread(() -> {
container.setScene(new Scene(entryEditor));
});
container.addKeyListener(new KeyAdapter() {
@Override
public void keyPressed(KeyEvent e) {
//We need to consume this event here to prevent the propgation of keybinding events back to the JFrame
Optional<KeyBinding> keyBinding = Globals.getKeyPrefs().mapToKeyBinding(e);
if (keyBinding.isPresent()) {
switch (keyBinding.get()) {
case CUT:
case COPY:
case PASTE:
case DELETE_ENTRY:
case SELECT_ALL:
e.consume();
break;
default:
//do nothing
}
}
}
});
return container; |
<<<<<<<
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Vector;
import javax.swing.plaf.TabbedPaneUI;
import javax.swing.plaf.basic.BasicTabbedPaneUI;
=======
import java.util.*;
>>>>>>>
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Vector;
import javax.swing.plaf.TabbedPaneUI;
import javax.swing.plaf.basic.BasicTabbedPaneUI;
import java.util.*;
<<<<<<<
import net.sf.jabref.gui.search.SearchBar;
=======
import net.sf.jabref.gui.util.FocusRequester;
import net.sf.jabref.gui.util.PositionWindow;
>>>>>>>
import net.sf.jabref.gui.search.SearchBar;
import net.sf.jabref.gui.util.FocusRequester;
import net.sf.jabref.gui.util.PositionWindow;
<<<<<<<
=======
// Let the search interface store changes to prefs.
// But which one? Let's use the one that is visible.
if (getCurrentBasePanel() != null) {
searchManager.updatePrefs();
}
>>>>>>>
<<<<<<<
openDatabaseOnlyActions.addAll(Arrays.asList(manageSelectors,
mergeDatabaseAction, newSubDatabaseAction, close, save, saveAs, saveSelectedAs, saveSelectedAsPlain, undo,
redo, cut, delete, copy, paste, mark, unmark, unmarkAll, editEntry,
selectAll, copyKey, copyCiteKey, copyKeyAndTitle, editPreamble, editStrings, toggleGroups,
makeKeyAction, normalSearch, mergeEntries, cleanupEntries, exportToClipboard,
replaceAll, sendAsEmail, downloadFullText, writeXmpAction,
=======
openDatabaseOnlyActions.addAll(Arrays.asList(manageSelectors, mergeDatabaseAction, newSubDatabaseAction, save,
saveAs, saveSelectedAs, saveSelectedAsPlain, undo, redo, cut, delete, copy, paste, mark, unmark,
unmarkAll, editEntry, selectAll, copyKey, copyCiteKey, copyKeyAndTitle, editPreamble, editStrings,
toggleGroups, toggleSearch, makeKeyAction, normalSearch, mergeEntries, cleanupEntries,
exportToClipboard, incrementalSearch, replaceAll, sendAsEmail, downloadFullText, writeXmpAction,
>>>>>>>
openDatabaseOnlyActions.addAll(Arrays.asList(manageSelectors, mergeDatabaseAction, newSubDatabaseAction, save,
saveAs, saveSelectedAs, saveSelectedAsPlain, undo, redo, cut, delete, copy, paste, mark, unmark,
unmarkAll, editEntry, selectAll, copyKey, copyCiteKey, copyKeyAndTitle, editPreamble, editStrings,
toggleGroups, makeKeyAction, normalSearch, mergeEntries, cleanupEntries, exportToClipboard,
replaceAll, sendAsEmail, downloadFullText, writeXmpAction,
<<<<<<<
} else {
title = file.getName();
}
// We use html here to get some padding around the title
// There are no closing tags since we would otherwise run in a bug
// see https://sourceforge.net/p/jabref/bugs/1293/
tabbedPane.add(htmlPadding + title, bp);
tabbedPane.setToolTipTextAt(tabbedPane.getTabCount() - 1,
file != null ? file.getAbsolutePath() : null);
if (raisePanel) {
tabbedPane.setSelectedComponent(bp);
=======
>>>>>>> |
<<<<<<<
/**
* Gets a list of linked files.
*
* @return the list of linked files, is never null but can be empty
*/
public List<LinkedFile> getFiles() {
//Extract the path
Optional<String> oldValue = getField(FieldName.FILE);
if (!oldValue.isPresent()) {
return Collections.emptyList();
}
return FileFieldParser.parse(oldValue.get());
}
=======
public void setDate(Date date) {
date.getYear().ifPresent(year -> setField(FieldName.YEAR, year.toString()));
date.getMonth().ifPresent(this::setMonth);
date.getDay().ifPresent(day -> setField(FieldName.DAY, day.toString()));
}
public Optional<Month> getMonth() {
return getFieldOrAlias(FieldName.MONTH).flatMap(Month::parse);
}
>>>>>>>
/**
* Gets a list of linked files.
*
* @return the list of linked files, is never null but can be empty
*/
public List<LinkedFile> getFiles() {
//Extract the path
Optional<String> oldValue = getField(FieldName.FILE);
if (!oldValue.isPresent()) {
return Collections.emptyList();
}
return FileFieldParser.parse(oldValue.get());
}
public void setDate(Date date) {
date.getYear().ifPresent(year -> setField(FieldName.YEAR, year.toString()));
date.getMonth().ifPresent(this::setMonth);
date.getDay().ifPresent(day -> setField(FieldName.DAY, day.toString()));
}
public Optional<Month> getMonth() {
return getFieldOrAlias(FieldName.MONTH).flatMap(Month::parse);
} |
<<<<<<<
if (Globals.prefs.getBoolean(JabRefPreferences.SHOW_RECOMMENDATIONS)) {
//related articles
addRelatedArticlesTab();
}
=======
// pdf annotations tab
addPdfTab();
//related articles
addRelatedArticlesTab();
>>>>>>>
if (Globals.prefs.getBoolean(JabRefPreferences.SHOW_RECOMMENDATIONS)) {
//related articles
addRelatedArticlesTab();
}
// pdf annotations tab
addPdfTab(); |
<<<<<<<
import net.sf.jabref.gui.help.HelpFiles;
import net.sf.jabref.gui.help.HelpAction;
=======
import net.sf.jabref.gui.help.HelpAction;
import net.sf.jabref.gui.help.HelpDialog;
import net.sf.jabref.gui.journals.ManageJournalsAction;
>>>>>>>
import net.sf.jabref.gui.help.HelpFiles;
import net.sf.jabref.gui.help.HelpAction;
import net.sf.jabref.gui.journals.ManageJournalsAction;
<<<<<<<
import net.sf.jabref.model.entry.*;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import net.sf.jabref.external.ExternalFileTypeEditor;
import net.sf.jabref.external.push.PushToApplicationButton;
import net.sf.jabref.external.push.PushToApplications;
import net.sf.jabref.groups.EntryTableTransferHandler;
import net.sf.jabref.groups.GroupSelector;
import net.sf.jabref.gui.menus.help.ForkMeOnGitHubAction;
import net.sf.jabref.gui.help.AboutAction;
import net.sf.jabref.gui.help.AboutDialog;
import net.sf.jabref.gui.journals.ManageJournalsAction;
=======
import net.sf.jabref.model.entry.BibEntry;
import net.sf.jabref.model.entry.BibtexEntryTypes;
import net.sf.jabref.model.entry.EntryType;
import net.sf.jabref.model.entry.IEEETranEntryTypes;
>>>>>>>
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import net.sf.jabref.gui.help.AboutAction;
import net.sf.jabref.gui.help.AboutDialog;
import net.sf.jabref.model.entry.BibEntry;
import net.sf.jabref.model.entry.BibtexEntryTypes;
import net.sf.jabref.model.entry.EntryType;
import net.sf.jabref.model.entry.IEEETranEntryTypes; |
<<<<<<<
import net.sf.jabref.bibtex.BibtexEntryAssert;
=======
import net.sf.jabref.importer.OutputPrinterToNull;
import net.sf.jabref.logic.bibtex.BibEntryAssert;
>>>>>>>
import net.sf.jabref.bibtex.BibtexEntryAssert;
import net.sf.jabref.importer.OutputPrinterToNull;
import net.sf.jabref.logic.bibtex.BibEntryAssert; |
<<<<<<<
import net.sf.jabref.gui.BasePanel;
import net.sf.jabref.gui.GUIGlobals;
import net.sf.jabref.gui.IconTheme;
import net.sf.jabref.gui.JabRefFrame;
import net.sf.jabref.gui.help.HelpFiles;
=======
import net.sf.jabref.gui.*;
>>>>>>>
import net.sf.jabref.gui.BasePanel;
import net.sf.jabref.gui.GUIGlobals;
import net.sf.jabref.gui.IconTheme;
import net.sf.jabref.gui.JabRefFrame;
import net.sf.jabref.gui.help.HelpFiles;
import net.sf.jabref.gui.*; |
<<<<<<<
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
=======
import ca.odell.glazedlists.swing.DefaultEventSelectionModel;
import ca.odell.glazedlists.swing.GlazedListsSwing;
import ca.odell.glazedlists.swing.TableComparatorChooser;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
>>>>>>>
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
<<<<<<<
private static final Log LOGGER = LogFactory.getLog(MainTable.class);
=======
private static final Logger LOGGER = LoggerFactory.getLogger(MainTable.class);
private final MainTableFormat tableFormat;
>>>>>>>
private static final Log LOGGER = LogFactory.getLog(MainTable.class); |
<<<<<<<
import net.sf.jabref.gui.keyboard.KeyBinding;
import net.sf.jabref.model.entry.BibtexEntry;
=======
import net.sf.jabref.gui.keyboard.KeyBinds;
import net.sf.jabref.model.entry.BibEntry;
>>>>>>>
import net.sf.jabref.gui.keyboard.KeyBinding;
import net.sf.jabref.model.entry.BibEntry; |
<<<<<<<
import net.sf.jabref.gui.keyboard.KeyBinding;
import net.sf.jabref.model.entry.BibtexEntry;
=======
import net.sf.jabref.model.entry.BibEntry;
>>>>>>>
import net.sf.jabref.gui.keyboard.KeyBinding;
import net.sf.jabref.model.entry.BibEntry; |
<<<<<<<
import org.apache.pdfbox.pdmodel.PDDocument;
=======
>>>>>>>
import org.apache.pdfbox.pdmodel.PDDocument;
<<<<<<<
private final JLabel authorLabel = new JLabel("author", JLabel.CENTER);
=======
private final JLabel authorLabel = new JLabel(Localization.lang("Author"), JLabel.CENTER);
>>>>>>>
private final JLabel authorLabel = new JLabel(Localization.lang("Author"), JLabel.CENTER);
<<<<<<<
private final JLabel dateLabel = new JLabel("date", JLabel.CENTER);
=======
private final JLabel dateLabel = new JLabel(Localization.lang("Date"), JLabel.CENTER);
>>>>>>>
private final JLabel dateLabel = new JLabel(Localization.lang("Date"), JLabel.CENTER);
<<<<<<<
private final JLabel pageLabel = new JLabel("page", JLabel.CENTER);
=======
private final JLabel pageLabel = new JLabel(Localization.lang("Page"), JLabel.CENTER);
>>>>>>>
private final JLabel pageLabel = new JLabel(Localization.lang("Page"), JLabel.CENTER);
<<<<<<<
=======
private final JScrollPane pageScrollPane = new JScrollPane();
private final JLabel commentTxtLabel = new JLabel(Localization.lang("Content"),JLabel.CENTER);
private final JTextArea commentTxtArea = new JTextArea("comment content", 10, 25);
private final JScrollPane commentTxtScrollPane = new JScrollPane();
>>>>>>>
private final JScrollPane pageScrollPane = new JScrollPane();
private final JLabel commentTxtLabel = new JLabel(Localization.lang("Content"),JLabel.CENTER);
private final JTextArea commentTxtArea = new JTextArea("comment content", 10, 25);
private final JScrollPane commentTxtScrollPane = new JScrollPane(); |
<<<<<<<
import javafx.application.Application;
import javafx.application.Platform;
import javafx.stage.Stage;
import net.sf.jabref.bibtex.InternalBibtexFields;
=======
>>>>>>>
import javafx.application.Application;
import javafx.application.Platform;
import javafx.stage.Stage;
<<<<<<<
public class JabRefMain extends Application {
=======
public class JabRefMain {
>>>>>>>
public class JabRefMain extends Application {
<<<<<<<
private static String[] arguments;
=======
>>>>>>>
private static String[] arguments;
<<<<<<<
@Override
public void start(Stage mainStage) throws Exception {
Platform.setImplicitExit(false);
SwingUtilities.invokeLater(() -> start(arguments));
}
=======
>>>>>>>
@Override
public void start(Stage mainStage) throws Exception {
Platform.setImplicitExit(false);
SwingUtilities.invokeLater(() -> start(arguments));
} |
<<<<<<<
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.n52.iceland.encode.ProcedureDescriptionFormatKey;
import org.n52.iceland.encode.ResponseFormatKey;
=======
import org.junit.Test;
import org.n52.iceland.coding.encode.ProcedureDescriptionFormatKey;
import org.n52.iceland.coding.encode.ResponseFormatKey;
import org.n52.iceland.config.AdministratorUser;
import org.n52.iceland.config.SettingDefinition;
import org.n52.iceland.config.SettingValue;
import org.n52.iceland.config.SettingsManager;
import org.n52.iceland.config.settings.BooleanSettingDefinition;
import org.n52.iceland.config.settings.ChoiceSettingDefinition;
import org.n52.iceland.config.settings.FileSettingDefinition;
import org.n52.iceland.config.settings.IntegerSettingDefinition;
import org.n52.iceland.config.settings.MultilingualStringSettingDefinition;
import org.n52.iceland.config.settings.NumericSettingDefinition;
import org.n52.iceland.config.settings.StringSettingDefinition;
import org.n52.iceland.config.settings.UriSettingDefinition;
import org.n52.iceland.ds.ConnectionProvider;
import org.n52.iceland.ds.ConnectionProviderException;
>>>>>>>
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.n52.iceland.coding.encode.ProcedureDescriptionFormatKey;
import org.n52.iceland.coding.encode.ResponseFormatKey; |
<<<<<<<
case MetaData.GROUPSTREE:
metaData.setGroups(GroupsParser.importGroups(value, keywordSeparator));
break;
case MetaData.SAVE_ACTIONS:
metaData.setSaveActions(Cleanups.parse(value));
break;
case MetaData.DATABASE_TYPE:
metaData.setMode(BibDatabaseMode.parse(getSingleItem(value)));
break;
case MetaData.KEYPATTERNDEFAULT:
defaultCiteKeyPattern = Collections.singletonList(getSingleItem(value));
break;
case MetaData.PROTECTED_FLAG_META:
if (Boolean.parseBoolean(getSingleItem(value))) {
metaData.markAsProtected();
} else {
metaData.markAsNotProtected();
}
break;
case MetaData.FILE_DIRECTORY:
metaData.setDefaultFileDirectory(getSingleItem(value));
break;
case MetaData.SAVE_ORDER_CONFIG:
metaData.setSaveOrderConfig(SaveOrderConfig.parse(value));
break;
default:
// Keep meta data items that we do not know in the file
metaData.putUnkownMetaDataItem(entry.getKey(), value);
=======
case MetaData.GROUPSTREE:
case MetaData.GROUPSTREE_LEGACY:
metaData.setGroups(GroupsParser.importGroups(value, keywordSeparator));
break;
case MetaData.SAVE_ACTIONS:
metaData.setSaveActions(Cleanups.parse(value));
break;
case MetaData.DATABASE_TYPE:
metaData.setMode(BibDatabaseMode.parse(getSingleItem(value)));
break;
case MetaData.KEYPATTERNDEFAULT:
defaultCiteKeyPattern = Collections.singletonList(getSingleItem(value));
break;
case MetaData.PROTECTED_FLAG_META:
if (Boolean.parseBoolean(getSingleItem(value))) {
metaData.markAsProtected();
} else {
metaData.markAsNotProtected();
}
break;
case MetaData.FILE_DIRECTORY:
metaData.setDefaultFileDirectory(getSingleItem(value));
break;
case MetaData.SAVE_ORDER_CONFIG:
metaData.setSaveOrderConfig(SaveOrderConfig.parse(value));
break;
case "groupsversion":
case "groups":
// These keys were used in previous JabRef versions, we will not support them anymore -> ignored
break;
>>>>>>>
case MetaData.GROUPSTREE:
case MetaData.GROUPSTREE_LEGACY:
metaData.setGroups(GroupsParser.importGroups(value, keywordSeparator));
break;
case MetaData.SAVE_ACTIONS:
metaData.setSaveActions(Cleanups.parse(value));
break;
case MetaData.DATABASE_TYPE:
metaData.setMode(BibDatabaseMode.parse(getSingleItem(value)));
break;
case MetaData.KEYPATTERNDEFAULT:
defaultCiteKeyPattern = Collections.singletonList(getSingleItem(value));
break;
case MetaData.PROTECTED_FLAG_META:
if (Boolean.parseBoolean(getSingleItem(value))) {
metaData.markAsProtected();
} else {
metaData.markAsNotProtected();
}
break;
case MetaData.FILE_DIRECTORY:
metaData.setDefaultFileDirectory(getSingleItem(value));
break;
case MetaData.SAVE_ORDER_CONFIG:
metaData.setSaveOrderConfig(SaveOrderConfig.parse(value));
break;
default:
// Keep meta data items that we do not know in the file
metaData.putUnkownMetaDataItem(entry.getKey(), value); |
<<<<<<<
public class DefaultAutoCompleter extends StringAbstractAutoCompleter {
public String _fieldName;
/**
* @see AutoCompleterFactory
*/
protected DefaultAutoCompleter(String fieldName) {
_fieldName = fieldName;
}
public boolean isSingleUnitField() {
return false;
}
public String[] complete(String s) {
return super.complete(s);
}
@Override
public void addBibtexEntry(BibtexEntry entry) {
if (entry != null) {
String fieldValue = entry.getField(_fieldName);
if (fieldValue != null) {
StringTokenizer tok = new StringTokenizer(fieldValue, Globals.SEPARATING_CHARS);
while (tok.hasMoreTokens()) {
String word = tok.nextToken();
addWordToIndex(word);
}
}
=======
class DefaultAutoCompleter extends AbstractAutoCompleter {
private final String fieldName;
/**
* @see AutoCompleterFactory
*/
DefaultAutoCompleter(String fieldName) {
this.fieldName = fieldName;
}
@Override
public boolean isSingleUnitField() {
return false;
}
@Override
public void addBibtexEntry(BibtexEntry entry) {
if (entry == null) {
return;
}
String fieldValue = entry.getField(fieldName);
if (fieldValue != null) {
StringTokenizer tok = new StringTokenizer(fieldValue, Globals.SEPARATING_CHARS);
while (tok.hasMoreTokens()) {
String word = tok.nextToken();
addWordToIndex(word);
}
>>>>>>>
class DefaultAutoCompleter extends AbstractAutoCompleter {
private final String fieldName;
/**
* @see AutoCompleterFactory
*/
DefaultAutoCompleter(String fieldName) {
this.fieldName = fieldName;
}
@Override
public boolean isSingleUnitField() {
return false;
}
@Override
public String[] complete(String s) {
return super.complete(s);
}
@Override
public void addBibtexEntry(BibtexEntry entry) {
if (entry == null) {
return;
}
String fieldValue = entry.getField(fieldName);
if (fieldValue != null) {
StringTokenizer tok = new StringTokenizer(fieldValue, Globals.SEPARATING_CHARS);
while (tok.hasMoreTokens()) {
String word = tok.nextToken();
addWordToIndex(word);
} |
<<<<<<<
HelpFiles.CONTENTS, Globals.getKeyPrefs().getKey(KeyBinding.HELP));
private final AbstractAction about = new AboutAction(Localization.menuTitle("About JabRef"), Localization.lang("About JabRef"),
IconTheme.getImage("about"));
=======
HelpFile.CONTENTS, Globals.getKeyPrefs().getKey(KeyBinding.HELP));
private final AbstractAction about = new AboutAction(Localization.menuTitle("About JabRef"), aboutDiag,
Localization.lang("About JabRef"), IconTheme.getImage("about"));
>>>>>>>
HelpFile.CONTENTS, Globals.getKeyPrefs().getKey(KeyBinding.HELP));
private final AbstractAction about = new AboutAction(Localization.menuTitle("About JabRef"), Localization.lang("About JabRef"),
IconTheme.getImage("about"));
<<<<<<<
options.add(keyBindingAction);
=======
options.add(protectTerms);
options.add(selectKeys);
>>>>>>>
options.add(keyBindingAction);
options.add(protectTerms); |
<<<<<<<
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.sciplore.beans.Document;
=======
>>>>>>>
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
<<<<<<<
case ImportDialog.MRDLIB:
metaDataListDialog = new MetaDataListDialog(fileName, true);
Tools.centerRelativeToWindow(metaDataListDialog, frame);
metaDataListDialog.showDialog();
Document document = metaDataListDialog.getXmlDocuments();
entry = null; // to satisfy the Java compiler
if (document != null && metaDataListDialog.getResult() == JOptionPane.OK_OPTION) {
int selected = metaDataListDialog.getTableMetadata().getSelectedRow();
if (selected > -1 /*&& selected < documents.getDocuments().size()*/) {
//Document document = documents/*.getDocuments().get(selected)*/;
String id = IdGenerator.next();
entry = new BibtexEntry(id);
if (fieldExists(document.getType())) {
type = BibtexEntryType.getStandardType(document.getType());
if (type == null) {
type = BibtexEntryType.ARTICLE;
}
entry.setType(type);
}
else {
entry.setType(BibtexEntryType.ARTICLE);
}
ArrayList<BibtexEntry> list = new ArrayList<BibtexEntry>();
list.add(entry);
Util.setAutomaticFields(list, true, true, false);
//insertFields(entry.getRequiredFields(), entry, document);
insertFields(BibtexFields.getAllFieldNames(), entry, document);
//insertFields(entry.getOptionalFields(), entry, document);
panel.database().insertEntry(entry);
dfh = new DroppedFileHandler(frame, panel);
dfh.linkPdfToEntry(fileName, entryTable, entry);
LabelPatternUtil.makeLabel(panel.metaData(), panel.database(), entry);
}
else {
entry = createNewBlankEntry(fileName);
}
}
else if (metaDataListDialog.getResult() == JOptionPane.CANCEL_OPTION) {
continue;
}
else if (metaDataListDialog.getResult() == JOptionPane.NO_OPTION) {
entry = createNewBlankEntry(fileName);
}
else if (document == null && metaDataListDialog.getResult() == JOptionPane.OK_OPTION) {
entry = createNewBlankEntry(fileName);
}
assert entry != null;
res.add(entry);
break;
=======
>>>>>>>
<<<<<<<
case ImportDialog.UPDATEEMPTYFIELDS:
metaDataListDialog = new MetaDataListDialog(fileName, false);
Tools.centerRelativeToWindow(metaDataListDialog, frame);
metaDataListDialog.showDialog();
document = metaDataListDialog.getXmlDocuments();
if (document != null && metaDataListDialog.getResult() == JOptionPane.OK_OPTION) {
int selected = metaDataListDialog.getTableMetadata().getSelectedRow();
if (selected > -1 /*&& selected < document.getDocuments().size()*/) {
//XmlDocument document = documents.getDocuments().get(selected);
entry = entryTable.getEntryAt(dropRow);
if (fieldExists(document.getType())) {
type = BibtexEntryType.getStandardType(document.getType());
if (type != null) {
entry.setType(type);
}
}
//insertFields(entry.getRequiredFields(), entry, document);
insertFields(BibtexFields.getAllFieldNames(), entry, document);
//insertFields(entry.getOptionalFields(), entry, document);
dfh = new DroppedFileHandler(frame, panel);
dfh.linkPdfToEntry(fileName, entryTable, dropRow);
}
}
break;
=======
>>>>>>> |
<<<<<<<
=======
import org.jabref.logic.xmp.XmpPreferences;
import org.jabref.preferences.JabRefPreferences;
>>>>>>>
import org.jabref.logic.xmp.XmpPreferences;
<<<<<<<
=======
public static ExporterFactory create(JabRefPreferences preferences, JournalAbbreviationLoader abbreviationLoader) {
Map<String, TemplateExporter> customFormats = preferences.customExports.getCustomExportFormats(preferences, abbreviationLoader);
LayoutFormatterPreferences layoutPreferences = preferences.getLayoutFormatterPreferences(abbreviationLoader);
SavePreferences savePreferences = SavePreferences.loadForExportFromPreferences(preferences);
XmpPreferences xmpPreferences = preferences.getXMPPreferences();
return create(customFormats, layoutPreferences, savePreferences, xmpPreferences);
}
>>>>>>> |
<<<<<<<
}
private static Stream<Formatter> getFormatters() {
// all classes implementing {@link net.sf.jabref.model.cleanup.Formatter}
// sorted alphabetically
// Alternative: Use reflection - https://github.com/ronmamo/reflections
return Stream.of(
new CapitalizeFormatter(),
new ClearFormatter(),
new HtmlToLatexFormatter(),
new HtmlToUnicodeFormatter(),
new IdentityFormatter(),
new LatexCleanupFormatter(),
new LatexToUnicodeFormatter(),
new LowerCaseFormatter(),
new MinifyNameListFormatter(),
new NormalizeDateFormatter(),
new NormalizeMonthFormatter(),
new NormalizeNamesFormatter(),
new NormalizePagesFormatter(),
new OrdinalsToSuperscriptFormatter(),
new ProtectTermsFormatter(protectedTermsLoader),
new RegexFormatter("(\" \",\"-\")"),
new RemoveBracesFormatter(),
new SentenceCaseFormatter(),
new TitleCaseFormatter(),
new UnicodeToLatexFormatter(),
new UnitsToLatexFormatter(),
new UpperCaseFormatter()
);
=======
/**
* When a new formatter is added by copy and pasting another formatter, it may happen that the <code>getKey()</code> method is not adapted. This results in duplicate keys, which this test tests for.
*/
@Test
public void allFormatterKeysAreUnique() {
// idea for uniqueness checking by https://stackoverflow.com/a/44032568/873282
assertEquals(Collections.emptyList(),
getFormatters().collect(Collectors.groupingBy(
formatter -> formatter.getKey(),
Collectors.counting()))
.entrySet().stream()
.filter(e -> e.getValue() > 1)
.map(Map.Entry::getKey)
.collect(Collectors.toList()));
>>>>>>>
private static Stream<Formatter> getFormatters() {
// all classes implementing {@link net.sf.jabref.model.cleanup.Formatter}
// sorted alphabetically
// Alternative: Use reflection - https://github.com/ronmamo/reflections
return Stream.of(
new CapitalizeFormatter(),
new ClearFormatter(),
new HtmlToLatexFormatter(),
new HtmlToUnicodeFormatter(),
new IdentityFormatter(),
new LatexCleanupFormatter(),
new LatexToUnicodeFormatter(),
new LowerCaseFormatter(),
new MinifyNameListFormatter(),
new NormalizeDateFormatter(),
new NormalizeMonthFormatter(),
new NormalizeNamesFormatter(),
new NormalizePagesFormatter(),
new OrdinalsToSuperscriptFormatter(),
new ProtectTermsFormatter(protectedTermsLoader),
new RegexFormatter("(\" \",\"-\")"),
new RemoveBracesFormatter(),
new SentenceCaseFormatter(),
new TitleCaseFormatter(),
new UnicodeToLatexFormatter(),
new UnitsToLatexFormatter(),
new UpperCaseFormatter()
);
}
/**
* When a new formatter is added by copy and pasting another formatter, it may happen that the <code>getKey()</code> method is not adapted. This results in duplicate keys, which this test tests for.
*/
@Test
public void allFormatterKeysAreUnique() {
// idea for uniqueness checking by https://stackoverflow.com/a/44032568/873282
assertEquals(Collections.emptyList(),
getFormatters().collect(Collectors.groupingBy(
formatter -> formatter.getKey(),
Collectors.counting()))
.entrySet().stream()
.filter(e -> e.getValue() > 1)
.map(Map.Entry::getKey)
.collect(Collectors.toList()));
<<<<<<<
=======
public static Stream<Formatter> getFormatters() {
// all classes implementing {@link net.sf.jabref.model.cleanup.Formatter}
// Alternative: Use reflection - https://github.com/ronmamo/reflections
// @formatter:off
return Stream.concat(
Formatters.getAll().stream(),
// following formatters are not contained in the list of all formatters, because
// - the IdentityFormatter is not offered to the user,
// - the ProtectTermsFormatter needs more configuration
Stream.of(
new IdentityFormatter(),
new ProtectTermsFormatter(protectedTermsLoader)));
// @formatter:on
}
>>>>>>>
public static Stream<Formatter> getFormatters() {
// all classes implementing {@link net.sf.jabref.model.cleanup.Formatter}
// Alternative: Use reflection - https://github.com/ronmamo/reflections
// @formatter:off
return Stream.concat(
Formatters.getAll().stream(),
// following formatters are not contained in the list of all formatters, because
// - the IdentityFormatter is not offered to the user,
// - the ProtectTermsFormatter needs more configuration
Stream.of(
new IdentityFormatter(),
new ProtectTermsFormatter(protectedTermsLoader)));
// @formatter:on
} |
<<<<<<<
import java.io.IOException;
import java.net.URISyntaxException;
import java.nio.charset.Charset;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import net.sf.jabref.Globals;
import net.sf.jabref.JabRefPreferences;
import net.sf.jabref.bibtex.BibtexEntryAssert;
=======
import java.io.IOException;
import java.io.InputStream;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import net.sf.jabref.Globals;
import net.sf.jabref.JabRefPreferences;
import net.sf.jabref.importer.OutputPrinterToNull;
import net.sf.jabref.logic.bibtex.BibEntryAssert;
>>>>>>>
import java.io.IOException;
import java.io.InputStream;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import net.sf.jabref.Globals;
import net.sf.jabref.JabRefPreferences;
import net.sf.jabref.importer.OutputPrinterToNull;
import net.sf.jabref.logic.bibtex.BibEntryAssert;
<<<<<<<
List<BibEntry> risEntries = risImporter.importDatabase(risFile, Charset.defaultCharset()).getDatabase().getEntries();
BibtexEntryAssert.assertEquals(RISImporterTest.class, fileName + ".bib", risEntries);
=======
try (InputStream risStream = RISImporterTest.class.getResourceAsStream(fileName + ".ris")) {
List<BibEntry> risEntries = risImporter.importEntries(risStream, new OutputPrinterToNull());
BibEntryAssert.assertEquals(RISImporterTest.class, fileName + ".bib", risEntries);
}
>>>>>>>
List<BibEntry> risEntries = risImporter.importDatabase(risFile, Charset.defaultCharset()).getDatabase().getEntries();
BibEntryAssert.assertEquals(RISImporterTest.class, fileName + ".bib", risEntries); |
<<<<<<<
entryFetchers.add(new IdBasedEntryFetcher(new DiVA(Globals.prefs.getImportFormatPreferences())));
entryFetchers.add(new IdBasedEntryFetcher(new DoiFetcher(Globals.prefs.getImportFormatPreferences())));
entryFetchers.add(new IdBasedEntryFetcher(new IsbnFetcher(Globals.prefs.getImportFormatPreferences())));
=======
>>>>>>> |
<<<<<<<
AutoCompleter<String> autoCompleter = JabRef.jrf.basePanel().getAutoCompleters().get("author");
=======
AutoCompleter autoCompleter = JabRef.jrf.getCurrentBasePanel().getAutoCompleters().get("author");
>>>>>>>
AutoCompleter<String> autoCompleter = JabRef.jrf.getCurrentBasePanel().getAutoCompleters().get("author");
<<<<<<<
AutoCompleter<String> autoCompleter = JabRef.jrf.basePanel().getAutoCompleters().get("journal");
=======
AutoCompleter autoCompleter = JabRef.jrf.getCurrentBasePanel().getAutoCompleters().get("journal");
>>>>>>>
AutoCompleter<String> autoCompleter = JabRef.jrf.getCurrentBasePanel().getAutoCompleters().get("journal"); |
<<<<<<<
private String convertToHex(java.awt.Color color) {
return String.format("#%02x%02x%02x", color.getRed(), color.getGreen(), color.getBlue());
}
=======
>>>>>>>
private String convertToHex(java.awt.Color color) {
return String.format("#%02x%02x%02x", color.getRed(), color.getGreen(), color.getBlue());
} |
<<<<<<<
public static final boolean LINUX = osName.startsWith("linux");
public static final boolean WINDOWS = osName.startsWith("win");
public static final boolean OS_X = osName.startsWith("mac");
public static boolean isWindows7OrLater() {
if (!WINDOWS) {
return false;
}
try {
Float version = Float.parseFloat(System.getProperty("os.version"));
// Windows 7 == 6.1
return version >= 6.1;
} catch (NumberFormatException ex) {
return false;
}
}
=======
public static final boolean LINUX = OS.osName.startsWith("linux");
public static final boolean WINDOWS = OS.osName.startsWith("win");
public static final boolean OS_X = OS.osName.startsWith("mac");
public static final String guessProgramPath(String programName, String windowsDirectory) {
if (OS.WINDOWS) {
String progFiles = System.getenv("ProgramFiles(x86)");
if (progFiles == null) {
progFiles = System.getenv("ProgramFiles");
}
if ((windowsDirectory != null) && !windowsDirectory.isEmpty()) {
return progFiles + "\\" + windowsDirectory + "\\" + programName + ".exe";
} else {
return progFiles + "\\" + programName + ".exe";
}
} else {
return programName;
}
}
public static final String guessProgramPath(String programName) {
return OS.guessProgramPath(programName, null);
}
>>>>>>>
public static final boolean LINUX = osName.startsWith("linux");
public static final boolean WINDOWS = osName.startsWith("win");
public static final boolean OS_X = osName.startsWith("mac");
public static boolean isWindows7OrLater() {
if (!WINDOWS) {
return false;
}
try {
Float version = Float.parseFloat(System.getProperty("os.version"));
// Windows 7 == 6.1
return version >= 6.1;
} catch (NumberFormatException ex) {
return false;
}
}
public static final String guessProgramPath(String programName, String windowsDirectory) {
if (OS.WINDOWS) {
String progFiles = System.getenv("ProgramFiles(x86)");
if (progFiles == null) {
progFiles = System.getenv("ProgramFiles");
}
if ((windowsDirectory != null) && !windowsDirectory.isEmpty()) {
return progFiles + "\\" + windowsDirectory + "\\" + programName + ".exe";
} else {
return progFiles + "\\" + programName + ".exe";
}
} else {
return programName;
}
}
public static final String guessProgramPath(String programName) {
return OS.guessProgramPath(programName, null);
} |
<<<<<<<
=======
import android.util.Log;
import android.view.ViewGroup;
import android.widget.RelativeLayout;
>>>>>>>
import android.util.Log; |
<<<<<<<
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
=======
import android.view.WindowManager;
>>>>>>>
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager;
<<<<<<<
public void setCurrentAspectRatio(int ratio) {
mCurrentAspectRatio = ratio;
if (mRenderView != null) {
mRenderView.setAspectRatio(mCurrentAspectRatio);
}
}
=======
>>>>>>> |
<<<<<<<
public String speakersNames() {
StringBuilder speakersBuilder = new StringBuilder();
for (Speaker speaker : speakers()) {
if (speakersBuilder.length() > 0) {
speakersBuilder.append(", ");
}
speakersBuilder.append(speaker.name());
}
return speakersBuilder.toString();
}
public boolean isHappeningAt(LocalDateTime time) {
return time.isAfter(startTime()) && time.isBefore(endTime());
}
=======
>>>>>>>
public boolean isHappeningAt(LocalDateTime time) {
return time.isAfter(startTime()) && time.isBefore(endTime());
} |
<<<<<<<
import android.content.Intent;
=======
import android.animation.ValueAnimator;
import android.content.res.Resources;
import android.graphics.drawable.ColorDrawable;
>>>>>>>
import android.animation.ValueAnimator;
import android.content.Intent;
import android.content.res.Resources;
import android.graphics.drawable.ColorDrawable;
<<<<<<<
import net.squanchy.navigation.view.HomeViewPagerAdapter;
import net.squanchy.navigation.view.NoSwipeViewPager;
import net.squanchy.search.OnSearchClickListener;
import net.squanchy.search.SearchActivity;
=======
>>>>>>>
import net.squanchy.search.OnSearchClickListener;
import net.squanchy.search.SearchActivity;
<<<<<<<
@Override
public void onSearchClick() {
startActivity(new Intent(this, SearchActivity.class));
}
=======
private void selectPage(BottomNavigationSection section) {
if (section == currentSection) {
return;
}
Fade transition = new Fade();
TransitionManager.beginDelayedTransition(pageContainer, transition);
if (currentSection != null) {
pageViews.get(currentSection).setVisibility(View.INVISIBLE);
}
pageViews.get(section).setVisibility(View.VISIBLE);
Resources.Theme theme = getThemeFor(section);
setStatusBarColor(getColorFromTheme(theme, android.R.attr.statusBarColor));
setBottomNavigationBarColor(getColorFromTheme(theme, android.support.design.R.attr.colorPrimary));
currentSection = section;
}
private Resources.Theme getThemeFor(BottomNavigationSection section) {
Resources.Theme theme = getResources().newTheme();
theme.setTo(getTheme());
theme.applyStyle(section.theme(), true);
return theme;
}
@ColorInt
private int getColorFromTheme(Resources.Theme theme, @AttrRes int attributeId) {
TypedValue typedValue = new TypedValue();
theme.resolveAttribute(attributeId, typedValue, true);
return typedValue.data;
}
private void setStatusBarColor(@ColorInt int color) {
Window window = getWindow();
int currentStatusBarColor = window.getStatusBarColor();
animateColor(currentStatusBarColor, color, animation -> window.setStatusBarColor((int) animation.getAnimatedValue()));
}
private void setBottomNavigationBarColor(@ColorInt int color) {
ColorDrawable backgroundDrawable = (ColorDrawable) bottomNavigationView.getBackground();
int currentBackgroundColor = backgroundDrawable.getColor();
animateColor(currentBackgroundColor, color, animation -> backgroundDrawable.setColor((int) animation.getAnimatedValue()));
}
private void animateColor(@ColorInt int currentColor, @ColorInt int targetColor, ValueAnimator.AnimatorUpdateListener listener) {
ValueAnimator animator = ValueAnimator.ofArgb(currentColor, targetColor).setDuration(pageFadeDurationMillis);
animator.addUpdateListener(listener);
animator.start();
}
>>>>>>>
private void selectPage(BottomNavigationSection section) {
if (section == currentSection) {
return;
}
Fade transition = new Fade();
TransitionManager.beginDelayedTransition(pageContainer, transition);
if (currentSection != null) {
pageViews.get(currentSection).setVisibility(View.INVISIBLE);
}
pageViews.get(section).setVisibility(View.VISIBLE);
Resources.Theme theme = getThemeFor(section);
setStatusBarColor(getColorFromTheme(theme, android.R.attr.statusBarColor));
setBottomNavigationBarColor(getColorFromTheme(theme, android.support.design.R.attr.colorPrimary));
currentSection = section;
}
private Resources.Theme getThemeFor(BottomNavigationSection section) {
Resources.Theme theme = getResources().newTheme();
theme.setTo(getTheme());
theme.applyStyle(section.theme(), true);
return theme;
}
@ColorInt
private int getColorFromTheme(Resources.Theme theme, @AttrRes int attributeId) {
TypedValue typedValue = new TypedValue();
theme.resolveAttribute(attributeId, typedValue, true);
return typedValue.data;
}
private void setStatusBarColor(@ColorInt int color) {
Window window = getWindow();
int currentStatusBarColor = window.getStatusBarColor();
animateColor(currentStatusBarColor, color, animation -> window.setStatusBarColor((int) animation.getAnimatedValue()));
}
private void setBottomNavigationBarColor(@ColorInt int color) {
ColorDrawable backgroundDrawable = (ColorDrawable) bottomNavigationView.getBackground();
int currentBackgroundColor = backgroundDrawable.getColor();
animateColor(currentBackgroundColor, color, animation -> backgroundDrawable.setColor((int) animation.getAnimatedValue()));
}
private void animateColor(@ColorInt int currentColor, @ColorInt int targetColor, ValueAnimator.AnimatorUpdateListener listener) {
ValueAnimator animator = ValueAnimator.ofArgb(currentColor, targetColor).setDuration(pageFadeDurationMillis);
animator.addUpdateListener(listener);
animator.start();
}
@Override
public void onSearchClick() {
startActivity(new Intent(this, SearchActivity.class));
} |
<<<<<<<
import net.squanchy.onboarding.OnboardingPage;
import net.squanchy.proximity.preconditions.ProximityOptInPersister;
import net.squanchy.service.proximity.injection.ProximityService;
=======
import net.squanchy.remoteconfig.RemoteConfig;
>>>>>>>
import net.squanchy.onboarding.OnboardingPage;
import net.squanchy.proximity.preconditions.ProximityOptInPersister;
import net.squanchy.service.proximity.injection.ProximityService;
import net.squanchy.remoteconfig.RemoteConfig;
<<<<<<<
public static final int REQUEST_TURN_LOCATION_ON = 6429;
=======
private final CompositeDisposable subscriptions = new CompositeDisposable();
>>>>>>>
public static final int REQUEST_TURN_LOCATION_ON = 6429;
private final CompositeDisposable subscriptions = new CompositeDisposable(); |
<<<<<<<
public String speakersNames() {
StringBuilder speakersBuilder = new StringBuilder();
for (Speaker speaker : speakers()) {
if (speakersBuilder.length() > 0) {
speakersBuilder.append(", ");
}
speakersBuilder.append(speaker.name());
}
return speakersBuilder.toString();
}
=======
public abstract Optional<String> description();
>>>>>>>
public abstract Optional<String> description();
public String speakersNames() {
StringBuilder speakersBuilder = new StringBuilder();
for (Speaker speaker : speakers()) {
if (speakersBuilder.length() > 0) {
speakersBuilder.append(", ");
}
speakersBuilder.append(speaker.name());
}
return speakersBuilder.toString();
} |
<<<<<<<
@Override
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
if (requestCode == MY_PERMISSIONS_REQUEST_ACCESS_FINE_LOCATION) {
if (hasGrantedFineLocationAccess(grantResults)) {
proximityService.startRadar();
}
}
}
private void askProximityPermissionToStartRadar() {
if (hasLocationPermission()) {
proximityService.startRadar();
} else {
ActivityCompat.requestPermissions(
this,
new String[]{Manifest.permission.ACCESS_FINE_LOCATION},
MY_PERMISSIONS_REQUEST_ACCESS_FINE_LOCATION
);
}
}
private boolean hasLocationPermission() {
int granted = ContextCompat.checkSelfPermission(
this,
Manifest.permission.ACCESS_FINE_LOCATION
);
return granted == PackageManager.PERMISSION_GRANTED;
}
private boolean hasGrantedFineLocationAccess(int[] grantResults) {
return grantResults.length > 0 &&
grantResults[0] == PackageManager.PERMISSION_GRANTED;
}
=======
//TODO fix it properly
@Override
protected void onResume() {
super.onResume();
Resources.Theme theme = getThemeFor(currentSection);
bottomNavigationView.setBackgroundColor(getColorFromTheme(theme, android.support.design.R.attr.colorPrimary));
}
>>>>>>>
@Override
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
if (requestCode == MY_PERMISSIONS_REQUEST_ACCESS_FINE_LOCATION) {
if (hasGrantedFineLocationAccess(grantResults)) {
proximityService.startRadar();
}
}
}
private void askProximityPermissionToStartRadar() {
if (hasLocationPermission()) {
proximityService.startRadar();
} else {
ActivityCompat.requestPermissions(
this,
new String[]{Manifest.permission.ACCESS_FINE_LOCATION},
MY_PERMISSIONS_REQUEST_ACCESS_FINE_LOCATION
);
}
}
private boolean hasLocationPermission() {
int granted = ContextCompat.checkSelfPermission(
this,
Manifest.permission.ACCESS_FINE_LOCATION
);
return granted == PackageManager.PERMISSION_GRANTED;
}
private boolean hasGrantedFineLocationAccess(int[] grantResults) {
return grantResults.length > 0 &&
grantResults[0] == PackageManager.PERMISSION_GRANTED;
}
//TODO fix it properly
@Override
protected void onResume() {
super.onResume();
Resources.Theme theme = getThemeFor(currentSection);
bottomNavigationView.setBackgroundColor(getColorFromTheme(theme, android.support.design.R.attr.colorPrimary));
} |
<<<<<<<
import android.content.Context;
import net.squanchy.proximity.ProximityProvider;
=======
import android.app.Application;
import net.squanchy.analytics.Analytics;
import net.squanchy.analytics.AnalyticsModule;
import net.squanchy.remoteconfig.RemoteConfig;
import net.squanchy.remoteconfig.RemoteConfigModule;
import net.squanchy.service.firebase.FirebaseAuthService;
>>>>>>>
import android.app.Application;
import net.squanchy.analytics.Analytics;
import net.squanchy.analytics.AnalyticsModule;
import net.squanchy.remoteconfig.RemoteConfig;
import net.squanchy.remoteconfig.RemoteConfigModule;
import net.squanchy.service.firebase.FirebaseAuthService;
<<<<<<<
@Component(modules = {FirebaseModule.class, ChecksumModule.class, RepositoryModule.class, ProximityModule.class})
=======
@Component(modules = {FirebaseModule.class, ChecksumModule.class, RepositoryModule.class, AnalyticsModule.class, RemoteConfigModule.class})
>>>>>>>
@Component(modules = {FirebaseModule.class, ChecksumModule.class, RepositoryModule.class, ProximityModule.class, AnalyticsModule.class, RemoteConfigModule.class})
<<<<<<<
ProximityService service();
=======
Analytics analytics();
RemoteConfig remoteConfig();
>>>>>>>
Analytics analytics();
RemoteConfig remoteConfig();
ProximityService service();
<<<<<<<
public static ApplicationComponent create(Context context) {
=======
public static ApplicationComponent create(Application application) {
>>>>>>>
public static ApplicationComponent create(Application application) {
<<<<<<<
.proximityModule(new ProximityModule(context))
=======
.analyticsModule(new AnalyticsModule(application))
.remoteConfigModule(new RemoteConfigModule())
>>>>>>>
.proximityModule(new ProximityModule(application))
.analyticsModule(new AnalyticsModule(application))
.remoteConfigModule(new RemoteConfigModule()) |
<<<<<<<
import net.squanchy.service.proximity.injection.ProximityService;
=======
import net.squanchy.remoteconfig.RemoteConfig;
>>>>>>>
import net.squanchy.service.proximity.injection.ProximityService;
import net.squanchy.remoteconfig.RemoteConfig;
<<<<<<<
private ProximityService proximityService;
=======
private Analytics analytics;
private RemoteConfig remoteConfig;
>>>>>>>
private ProximityService proximityService;
private Analytics analytics;
private RemoteConfig remoteConfig; |
<<<<<<<
apiEvent.experienceLevel,
map(speakers, toSpeaker())
);
=======
ExperienceLevel.fromRawLevel(apiEvent.experienceLevel - 1), // TODO fix the data
map(speakers, toSpeakerName()));
>>>>>>>
ExperienceLevel.fromRawLevel(apiEvent.experienceLevel - 1), // TODO fix the data
map(speakers, toSpeaker())
); |
<<<<<<<
=======
>>>>>>> |
<<<<<<<
classes = BootStackConfigurationAwsTest.BootStackConfigurationAwsTestConfig.class)
class BootStackConfigurationAwsTest extends StackConfigurationAwsTest {
=======
classes = BootStackConfigurationAwsTest.BootStackConfigurationAwsTestConfig.class,
properties = {
"cloud.aws.credentials.access-key=${aws-integration-tests.accessKey}",
"cloud.aws.credentials.secret-key=${aws-integration-tests.secretKey}" })
public class BootStackConfigurationAwsTest extends StackConfigurationAwsTest {
>>>>>>>
classes = BootStackConfigurationAwsTest.BootStackConfigurationAwsTestConfig.class,
properties = {
"cloud.aws.credentials.access-key=${aws-integration-tests.accessKey}",
"cloud.aws.credentials.secret-key=${aws-integration-tests.secretKey}" })
class BootStackConfigurationAwsTest extends StackConfigurationAwsTest { |
<<<<<<<
@SpringBootTest(classes = BootMailSenderAwsTest.BootMailSenderAwsTestConfig.class)
class BootMailSenderAwsTest extends MailSenderAwsTest {
=======
@SpringBootTest(classes = BootMailSenderAwsTest.BootMailSenderAwsTestConfig.class,
properties = {
"cloud.aws.credentials.access-key=${aws-integration-tests.accessKey}",
"cloud.aws.credentials.secret-key=${aws-integration-tests.secretKey}" })
public class BootMailSenderAwsTest extends MailSenderAwsTest {
>>>>>>>
@SpringBootTest(classes = BootMailSenderAwsTest.BootMailSenderAwsTestConfig.class,
properties = {
"cloud.aws.credentials.access-key=${aws-integration-tests.accessKey}",
"cloud.aws.credentials.secret-key=${aws-integration-tests.secretKey}" })
class BootMailSenderAwsTest extends MailSenderAwsTest { |
<<<<<<<
@ContextConfiguration(classes = JavaQueueListenerTest.JavaQueueListenerTestConfiguration.class)
class JavaQueueListenerTest extends QueueListenerTest {
=======
@ContextConfiguration(
classes = JavaQueueListenerTest.JavaQueueListenerTestConfiguration.class)
public class JavaQueueListenerTest extends QueueListenerTest {
>>>>>>>
@ContextConfiguration(
classes = JavaQueueListenerTest.JavaQueueListenerTestConfiguration.class)
class JavaQueueListenerTest extends QueueListenerTest { |
<<<<<<<
@ContextConfiguration(classes = JavaNotificationMessagingTemplateIntegrationTest.NotificationMessagingTemplateIntegrationTestConfiguration.class)
class JavaNotificationMessagingTemplateIntegrationTest
=======
@ContextConfiguration(
classes = JavaNotificationMessagingTemplateIntegrationTest.NotificationMessagingTemplateIntegrationTestConfiguration.class)
public class JavaNotificationMessagingTemplateIntegrationTest
>>>>>>>
@ContextConfiguration(
classes = JavaNotificationMessagingTemplateIntegrationTest.NotificationMessagingTemplateIntegrationTestConfiguration.class)
class JavaNotificationMessagingTemplateIntegrationTest |
<<<<<<<
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
=======
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.junit.runner.RunWith;
>>>>>>>
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
<<<<<<<
void testGetUserProperties() throws Exception {
Assertions.assertEquals("tagv1",
this.context.getBeanFactory().getBeanExpressionResolver().evaluate(
"#{instanceData['tag1']}",
new BeanExpressionContext(this.context.getBeanFactory(), null)));
Assertions.assertEquals("tagv2",
this.context.getBeanFactory().getBeanExpressionResolver().evaluate(
"#{instanceData['tag2']}",
new BeanExpressionContext(this.context.getBeanFactory(), null)));
Assertions.assertEquals("tagv3",
this.context.getBeanFactory().getBeanExpressionResolver().evaluate(
"#{instanceData['tag3']}",
new BeanExpressionContext(this.context.getBeanFactory(), null)));
Assertions.assertEquals("tagv4",
this.context.getBeanFactory().getBeanExpressionResolver().evaluate(
"#{instanceData['tag4']}",
new BeanExpressionContext(this.context.getBeanFactory(), null)));
=======
public void testGetUserProperties() throws Exception {
assertThat(this.context.getBeanFactory().getBeanExpressionResolver().evaluate(
"#{instanceData['tag1']}",
new BeanExpressionContext(this.context.getBeanFactory(), null)))
.isEqualTo("tagv1");
assertThat(this.context.getBeanFactory().getBeanExpressionResolver().evaluate(
"#{instanceData['tag2']}",
new BeanExpressionContext(this.context.getBeanFactory(), null)))
.isEqualTo("tagv2");
assertThat(this.context.getBeanFactory().getBeanExpressionResolver().evaluate(
"#{instanceData['tag3']}",
new BeanExpressionContext(this.context.getBeanFactory(), null)))
.isEqualTo("tagv3");
assertThat(this.context.getBeanFactory().getBeanExpressionResolver().evaluate(
"#{instanceData['tag4']}",
new BeanExpressionContext(this.context.getBeanFactory(), null)))
.isEqualTo("tagv4");
>>>>>>>
void testGetUserProperties() throws Exception {
assertThat(this.context.getBeanFactory().getBeanExpressionResolver().evaluate(
"#{instanceData['tag1']}",
new BeanExpressionContext(this.context.getBeanFactory(), null)))
.isEqualTo("tagv1");
assertThat(this.context.getBeanFactory().getBeanExpressionResolver().evaluate(
"#{instanceData['tag2']}",
new BeanExpressionContext(this.context.getBeanFactory(), null)))
.isEqualTo("tagv2");
assertThat(this.context.getBeanFactory().getBeanExpressionResolver().evaluate(
"#{instanceData['tag3']}",
new BeanExpressionContext(this.context.getBeanFactory(), null)))
.isEqualTo("tagv3");
assertThat(this.context.getBeanFactory().getBeanExpressionResolver().evaluate(
"#{instanceData['tag4']}",
new BeanExpressionContext(this.context.getBeanFactory(), null)))
.isEqualTo("tagv4"); |
<<<<<<<
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
=======
import static org.assertj.core.api.Assertions.assertThat;
>>>>>>>
import static org.assertj.core.api.Assertions.assertThat;
<<<<<<<
void listenToAllMessagesUntilTheyAreReceivedOrTimeOut() throws Exception {
assertTrue(this.messageReceiver.getCountDownLatch().await(5, TimeUnit.MINUTES));
=======
public void listenToAllMessagesUntilTheyAreReceivedOrTimeOut() throws Exception {
assertThat(this.messageReceiver.getCountDownLatch().await(5, TimeUnit.MINUTES))
.isTrue();
>>>>>>>
void listenToAllMessagesUntilTheyAreReceivedOrTimeOut() throws Exception {
assertThat(this.messageReceiver.getCountDownLatch().await(5, TimeUnit.MINUTES))
.isTrue(); |
<<<<<<<
* Regex matching can be based on either the host name (default) or host ip address. To set this balancer to match the regular expressions to the tablet server
* IP address, then set the following property:<br>
=======
* (Deprecated) Periodically (default 1m) this balancer will regroup the set of current tablet
* servers into pools based on regexes applied to the tserver host names. This would cover the case
* of tservers dying or coming online. To change the host pool check time period, set the following
* property: <br>
* <b>table.custom.balancer.host.regex.pool.check=5m (Deprecated)</b><br>
* Regex matching can be based on either the host name (default) or host ip address. To set this
* balancer to match the regular expressions to the tablet server IP address, then set the following
* property:<br>
>>>>>>>
* Regex matching can be based on either the host name (default) or host ip address. To set this
* balancer to match the regular expressions to the tablet server IP address, then set the following
* property:<br>
<<<<<<<
public static final String HOST_BALANCER_REGEX_USING_IPS_KEY = Property.TABLE_ARBITRARY_PROP_PREFIX.getKey() + "balancer.host.regex.is.ip";
public static final String HOST_BALANCER_REGEX_MAX_MIGRATIONS_KEY = Property.TABLE_ARBITRARY_PROP_PREFIX.getKey()
+ "balancer.host.regex.concurrent.migrations";
=======
@Deprecated
public static final String HOST_BALANCER_POOL_RECHECK_KEY = Property.TABLE_ARBITRARY_PROP_PREFIX
.getKey() + "balancer.host.regex.pool.check";
public static final String HOST_BALANCER_REGEX_USING_IPS_KEY = Property.TABLE_ARBITRARY_PROP_PREFIX
.getKey() + "balancer.host.regex.is.ip";
public static final String HOST_BALANCER_REGEX_MAX_MIGRATIONS_KEY = Property.TABLE_ARBITRARY_PROP_PREFIX
.getKey() + "balancer.host.regex.concurrent.migrations";
>>>>>>>
public static final String HOST_BALANCER_REGEX_USING_IPS_KEY = Property.TABLE_ARBITRARY_PROP_PREFIX
.getKey() + "balancer.host.regex.is.ip";
public static final String HOST_BALANCER_REGEX_MAX_MIGRATIONS_KEY = Property.TABLE_ARBITRARY_PROP_PREFIX
.getKey() + "balancer.host.regex.concurrent.migrations";
<<<<<<<
Table.ID tableId = Table.ID.of(table.getValue());
tableIdToTableName.put(tableId, table.getKey());
conf.getTableConfiguration(tableId).addObserver(this);
Map<String,String> customProps = conf.getTableConfiguration(tableId).getAllPropertiesWithPrefix(Property.TABLE_ARBITRARY_PROP_PREFIX);
=======
tableIdToTableName.put(table.getValue(), table.getKey());
conf.getTableConfiguration(table.getValue()).addObserver(this);
Map<String,String> customProps = conf.getTableConfiguration(table.getValue())
.getAllPropertiesWithPrefix(Property.TABLE_ARBITRARY_PROP_PREFIX);
>>>>>>>
Table.ID tableId = Table.ID.of(table.getValue());
tableIdToTableName.put(tableId, table.getKey());
conf.getTableConfiguration(tableId).addObserver(this);
Map<String,String> customProps = conf.getTableConfiguration(tableId)
.getAllPropertiesWithPrefix(Property.TABLE_ARBITRARY_PROP_PREFIX); |
<<<<<<<
@SpringBootTest(classes = BootElastiCacheAwsTest.BootElastiCacheAwsTestConfig.class)
class BootElastiCacheAwsTest extends ElastiCacheAwsTest {
=======
@SpringBootTest(classes = BootElastiCacheAwsTest.BootElastiCacheAwsTestConfig.class,
properties = {
"cloud.aws.credentials.access-key=${aws-integration-tests.accessKey}",
"cloud.aws.credentials.secret-key=${aws-integration-tests.secretKey}" })
public class BootElastiCacheAwsTest extends ElastiCacheAwsTest {
>>>>>>>
@SpringBootTest(classes = BootElastiCacheAwsTest.BootElastiCacheAwsTestConfig.class,
properties = {
"cloud.aws.credentials.access-key=${aws-integration-tests.accessKey}",
"cloud.aws.credentials.secret-key=${aws-integration-tests.secretKey}" })
class BootElastiCacheAwsTest extends ElastiCacheAwsTest { |
<<<<<<<
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
=======
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.junit.runner.RunWith;
>>>>>>>
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
<<<<<<<
import static org.junit.jupiter.api.Assertions.assertNotNull;
=======
import static org.assertj.core.api.Assertions.assertThat;
>>>>>>>
import static org.assertj.core.api.Assertions.assertThat;
<<<<<<<
@ExtendWith(SpringExtension.class)
=======
@RunWith(SpringJUnit4ClassRunner.class)
@Category(AWSIntegration.class)
>>>>>>>
@ExtendWith(SpringExtension.class)
@AWSIntegration
<<<<<<<
void testInstanceDataResolution() throws Exception {
Assertions.assertEquals("value1", this.simpleConfigurationBean.getValue1());
Assertions.assertEquals("value2", this.simpleConfigurationBean.getValue2());
Assertions.assertEquals("value3", this.simpleConfigurationBean.getValue3());
Assertions.assertEquals("i123456", this.simpleConfigurationBean.getValue4());
=======
public void testInstanceDataResolution() throws Exception {
assertThat(this.simpleConfigurationBean.getValue1()).isEqualTo("value1");
assertThat(this.simpleConfigurationBean.getValue2()).isEqualTo("value2");
assertThat(this.simpleConfigurationBean.getValue3()).isEqualTo("value3");
assertThat(this.simpleConfigurationBean.getValue4()).isEqualTo("i123456");
>>>>>>>
void testInstanceDataResolution() throws Exception {
assertThat(this.simpleConfigurationBean.getValue1()).isEqualTo("value1");
assertThat(this.simpleConfigurationBean.getValue2()).isEqualTo("value2");
assertThat(this.simpleConfigurationBean.getValue3()).isEqualTo("value3");
assertThat(this.simpleConfigurationBean.getValue4()).isEqualTo("i123456"); |
<<<<<<<
"cloud.aws.loader.queueCapacity=0" })
class BootResourceLoaderAwsTest extends ResourceLoaderAwsTest {
=======
"cloud.aws.loader.queueCapacity=0",
"cloud.aws.credentials.access-key=${aws-integration-tests.accessKey}",
"cloud.aws.credentials.secret-key=${aws-integration-tests.secretKey}" })
public class BootResourceLoaderAwsTest extends ResourceLoaderAwsTest {
>>>>>>>
"cloud.aws.loader.queueCapacity=0",
"cloud.aws.credentials.access-key=${aws-integration-tests.accessKey}",
"cloud.aws.credentials.secret-key=${aws-integration-tests.secretKey}" })
class BootResourceLoaderAwsTest extends ResourceLoaderAwsTest { |
<<<<<<<
import static org.junit.Assert.assertTrue;
=======
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
>>>>>>>
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.assertTrue; |
<<<<<<<
@ContextConfiguration(classes = JavaQueueMessagingTemplateIntegrationTest.QueueMessagingTemplateIntegrationTestConfiguration.class)
class JavaQueueMessagingTemplateIntegrationTest
=======
@ContextConfiguration(
classes = JavaQueueMessagingTemplateIntegrationTest.QueueMessagingTemplateIntegrationTestConfiguration.class)
public class JavaQueueMessagingTemplateIntegrationTest
>>>>>>>
@ContextConfiguration(
classes = JavaQueueMessagingTemplateIntegrationTest.QueueMessagingTemplateIntegrationTestConfiguration.class)
class JavaQueueMessagingTemplateIntegrationTest |
<<<<<<<
final private ReplicationStorage storageMemoryReplication;
public StorageMemory() {
this.storageMemoryReplication = new StorageMemoryReplicationNRoot();
}
public StorageMemory(final ReplicationStorage storageMemoryReplication) {
this.storageMemoryReplication = storageMemoryReplication;
}
=======
// Responsibility
final private Map<Number160, Number160> responsibilityMap = new ConcurrentHashMap<Number160, Number160>();
final private Map<Number160, Set<Number160>> responsibilityMapRev = new ConcurrentHashMap<Number160, Set<Number160>>();
>>>>>>>
// Responsibility
final private Map<Number160, Set<Number160>> responsibilityMap = new ConcurrentHashMap<Number160, Set<Number160>>();
final private Map<Number160, Set<Number160>> responsibilityMapRev = new ConcurrentHashMap<Number160, Set<Number160>>(); |
<<<<<<<
final HolePRPC holePunchRPC = new HolePRPC(peer);
final RelayRPC relayRPC = new RelayRPC(peer, rconRPC, holePunchRPC, gcmSenderRPC, bufferConfig, connectionConfiguration);
=======
final HolePunchRPC holePunchRPC = new HolePunchRPC(peer);
if(relayServerConfigurations == null) {
relayServerConfigurations = new HashMap<RelayType, RelayServerConfig>(0);
} else {
// start the server configurations
for (RelayServerConfig config : relayServerConfigurations.values()) {
config.start(peer);
}
}
final RelayRPC relayRPC = new RelayRPC(peer, rconRPC, holePunchRPC, relayServerConfigurations);
>>>>>>>
final HolePRPC holePunchRPC = new HolePRPC(peer);
if(relayServerConfigurations == null) {
relayServerConfigurations = new HashMap<RelayType, RelayServerConfig>(0);
} else {
// start the server configurations
for (RelayServerConfig config : relayServerConfigurations.values()) {
config.start(peer);
}
}
final RelayRPC relayRPC = new RelayRPC(peer, rconRPC, holePunchRPC, relayServerConfigurations);
<<<<<<<
peer.peerBean().holePunchInitiator(new HolePInitiatorImpl(peer));
return new PeerNAT(peer, natUtils, relayRPC, manualPorts, connectionConfiguration);
=======
peer.peerBean().holePunchInitiator(new HolePunchInitiatorImpl(peer));
return new PeerNAT(peer, natUtils, relayRPC, manualPorts);
>>>>>>>
peer.peerBean().holePunchInitiator(new HolePInitiatorImpl(peer));
return new PeerNAT(peer, natUtils, relayRPC, manualPorts); |
<<<<<<<
import net.tomp2p.rcon.RconRPC;
=======
import net.tomp2p.peers.PeerStatusListener;
>>>>>>>
import net.tomp2p.rcon.RconRPC;
import net.tomp2p.peers.PeerStatusListener;
<<<<<<<
public RelayForwarderRPC(PeerConnection peerConnection, Peer peer, RelayRPC relayRPC, RconRPC rconRPC) {
=======
public RelayForwarderRPC(final PeerConnection peerConnection, final Peer peer, final RelayRPC relayRPC) {
>>>>>>>
public RelayForwarderRPC(final PeerConnection peerConnection, final Peer peer, final RelayRPC relayRPC, RconRPC rconRPC) {
<<<<<<<
=======
@Override
public boolean peerFailed(PeerAddress remotePeer, PeerException exception) {
//not handled here
return false;
}
@Override
public boolean peerFound(PeerAddress remotePeer, PeerAddress referrer, PeerConnection peerConnection2) {
boolean firstHand = referrer == null;
boolean secondHand = remotePeer.equals(referrer);
boolean samePeerConnection = peerConnection.equals(peerConnection2);
//if firsthand, then full trust, if second hand and a stable peerconnection, we can trust as well
if((firstHand || (secondHand && samePeerConnection))
&& remotePeer.peerId().equals(unreachablePeer.peerId())
&& remotePeer.isRelayed()) {
//we got new information about this peer, e.g. its active relays
LOG.debug("update the unreachable peer to {} based on {}, ref {}", unreachablePeer, remotePeer, referrer);
unreachablePeer = remotePeer;
}
return false;
}
>>>>>>>
@Override
public boolean peerFailed(PeerAddress remotePeer, PeerException exception) {
//not handled here
return false;
}
@Override
public boolean peerFound(PeerAddress remotePeer, PeerAddress referrer, PeerConnection peerConnection2) {
boolean firstHand = referrer == null;
boolean secondHand = remotePeer.equals(referrer);
boolean samePeerConnection = peerConnection.equals(peerConnection2);
//if firsthand, then full trust, if second hand and a stable peerconnection, we can trust as well
if((firstHand || (secondHand && samePeerConnection))
&& remotePeer.peerId().equals(unreachablePeer.peerId())
&& remotePeer.isRelayed()) {
//we got new information about this peer, e.g. its active relays
LOG.debug("update the unreachable peer to {} based on {}, ref {}", unreachablePeer, remotePeer, referrer);
unreachablePeer = remotePeer;
}
return false;
}
<<<<<<<
.registerIoHandler(peerConnection.remotePeer().peerId(), rconRPC, RPC.Commands.RCON.getNr());
=======
.registerIoHandler(unreachablePeer.peerId(), this, command.getNr());
>>>>>>>
.registerIoHandler(peerConnection.remotePeer().peerId(), rconRPC, RPC.Commands.RCON.getNr());
<<<<<<<
// TODO: make sure if a peerconnection is dead, unregister is called
public static void unregister(Peer peer, Number160 unreachablePeer) {
peer.connectionBean().dispatcher().removeIoHandler(unreachablePeer);
}
=======
>>>>>>>
<<<<<<<
public void handleResponse(final Message message, PeerConnection peerConnectionUnused, final boolean sign, final Responder responder)
throws Exception {
=======
public void handleResponse(final Message message, PeerConnection peerConnectionUnused, final boolean sign,
final Responder responder) throws Exception {
//TODO
>>>>>>>
public void handleResponse(final Message message, PeerConnection peerConnectionUnused, final boolean sign,
final Responder responder) throws Exception {
//TODO
<<<<<<<
LOG.trace("Answering routing request on behalf of unreachable peer {}, neighbors of {}", peerConnection.remotePeer(), id);
if (peerMap == null) {
return null;
} else {
return PeerMap.closePeers(peerConnection.remotePeer().peerId(), id, NeighborRPC.NEIGHBOR_SIZE, peerMap);
}
}
=======
LOG.trace("Answering routing request on behalf of unreachable peer {}, neighbors of {}", unreachablePeer, id);
if(peerMap == null) {
return null;
} else {
return PeerMap.closePeers(unreachablePeer.peerId(), id, NeighborRPC.NEIGHBOR_SIZE, peerMap);
}
}
>>>>>>>
LOG.trace("Answering routing request on behalf of unreachable peer {}, neighbors of {}", unreachablePeer, id);
if(peerMap == null) {
return null;
} else {
return PeerMap.closePeers(unreachablePeer.peerId(), id, NeighborRPC.NEIGHBOR_SIZE, peerMap);
}
} |
<<<<<<<
context.getServerConfigurationFactory().getTableConfiguration(tablet.getTableId()))
.withBlockCache(dataCache, indexCache).build();
=======
context.getServerConfigurationFactory().getTableConfiguration(tablet))
.withBlockCache(dataCache, indexCache).withFileLenCache(fileLenCache).build();
>>>>>>>
context.getServerConfigurationFactory().getTableConfiguration(tablet.getTableId()))
.withBlockCache(dataCache, indexCache).withFileLenCache(fileLenCache).build(); |
<<<<<<<
=======
FutureGet futureGet1a = p1.get(lKey).contentKey(cKey).start();
futureGet1a.awaitUninterruptibly();
Assert.assertTrue(futureGet1a.isSuccess());
Assert.assertEquals(testData1, (String) futureGet1a.data().object());
FutureGet futureGet1b = p2.get(lKey).contentKey(cKey).start();
futureGet1b.awaitUninterruptibly();
Assert.assertTrue(futureGet1b.isSuccess());
Assert.assertEquals(testData1, (String) futureGet1b.data().object());
// try to remove without key pair
// -------------------------------------------------------
FutureRemove futureRemove1a = p1.remove(lKey).contentKey(cKey)
.start();
futureRemove1a.awaitUninterruptibly();
Assert.assertFalse(futureRemove1a.isRemoved());
FutureGet futureGet2a = p1.get(lKey).contentKey(cKey).start();
futureGet2a.awaitUninterruptibly();
Assert.assertTrue(futureGet2a.isSuccess());
// should have been not modified
Assert.assertEquals(testData1, (String) futureGet2a.data().object());
FutureRemove futureRemove1b = p2.remove(lKey).contentKey(cKey)
.start();
futureRemove1b.awaitUninterruptibly();
Assert.assertFalse(futureRemove1b.isRemoved());
FutureGet futureGet2b = p2.get(lKey).contentKey(cKey).start();
futureGet2b.awaitUninterruptibly();
Assert.assertTrue(futureGet2b.isSuccess());
// should have been not modified
Assert.assertEquals(testData1, (String) futureGet2b.data().object());
// try to remove with wrong key pair
// ---------------------------------------------------
FutureRemove futureRemove2a = p1.remove(lKey).contentKey(cKey)
.keyPair(keyPair2).start();
futureRemove2a.awaitUninterruptibly();
Assert.assertFalse(futureRemove2a.isRemoved());
FutureGet futureGet3a = p1.get(lKey).contentKey(cKey).start();
futureGet3a.awaitUninterruptibly();
Assert.assertTrue(futureGet3a.isSuccess());
// should have been not modified
Assert.assertEquals(testData1, (String) futureGet3a.data().object());
FutureRemove futureRemove2b = p2.remove(lKey).contentKey(cKey)
.start();
futureRemove2b.awaitUninterruptibly();
Assert.assertFalse(futureRemove2b.isRemoved());
FutureGet futureGet3b = p2.get(lKey).contentKey(cKey).start();
futureGet3b.awaitUninterruptibly();
Assert.assertTrue(futureGet3b.isSuccess());
// should have been not modified
Assert.assertEquals(testData1, (String) futureGet3b.data().object());
// remove with correct key pair
// ---------------------------------------------------------
FutureRemove futureRemove4 = p1.remove(lKey).contentKey(cKey)
.keyPair(keyPair1).start();
futureRemove4.awaitUninterruptibly();
Assert.assertTrue(futureRemove4.isRemoved());
FutureGet futureGet4a = p2.get(lKey).contentKey(cKey).start();
futureGet4a.awaitUninterruptibly();
Assert.assertFalse(futureGet4a.isSuccess());
// should have been removed
Assert.assertNull(futureGet4a.data());
FutureGet futureGet4b = p2.get(lKey).contentKey(cKey).start();
futureGet4b.awaitUninterruptibly();
Assert.assertFalse(futureGet4b.isSuccess());
// should have been removed
Assert.assertNull(futureGet4b.data());
>>>>>>>
FutureGet futureGet1a = p1.get(lKey).contentKey(cKey).start();
futureGet1a.awaitUninterruptibly();
Assert.assertTrue(futureGet1a.isSuccess());
Assert.assertEquals(testData1, (String) futureGet1a.data().object());
FutureGet futureGet1b = p2.get(lKey).contentKey(cKey).start();
futureGet1b.awaitUninterruptibly();
Assert.assertTrue(futureGet1b.isSuccess());
Assert.assertEquals(testData1, (String) futureGet1b.data().object());
// try to remove without key pair
// -------------------------------------------------------
FutureRemove futureRemove1a = p1.remove(lKey).contentKey(cKey)
.start();
futureRemove1a.awaitUninterruptibly();
Assert.assertFalse(futureRemove1a.isRemoved());
FutureGet futureGet2a = p1.get(lKey).contentKey(cKey).start();
futureGet2a.awaitUninterruptibly();
Assert.assertTrue(futureGet2a.isSuccess());
// should have been not modified
Assert.assertEquals(testData1, (String) futureGet2a.data().object());
FutureRemove futureRemove1b = p2.remove(lKey).contentKey(cKey)
.start();
futureRemove1b.awaitUninterruptibly();
Assert.assertFalse(futureRemove1b.isRemoved());
FutureGet futureGet2b = p2.get(lKey).contentKey(cKey).start();
futureGet2b.awaitUninterruptibly();
Assert.assertTrue(futureGet2b.isSuccess());
// should have been not modified
Assert.assertEquals(testData1, (String) futureGet2b.data().object());
// try to remove with wrong key pair
// ---------------------------------------------------
FutureRemove futureRemove2a = p1.remove(lKey).contentKey(cKey)
.keyPair(keyPair2).start();
futureRemove2a.awaitUninterruptibly();
Assert.assertFalse(futureRemove2a.isRemoved());
FutureGet futureGet3a = p1.get(lKey).contentKey(cKey).start();
futureGet3a.awaitUninterruptibly();
Assert.assertTrue(futureGet3a.isSuccess());
// should have been not modified
Assert.assertEquals(testData1, (String) futureGet3a.data().object());
FutureRemove futureRemove2b = p2.remove(lKey).contentKey(cKey)
.start();
futureRemove2b.awaitUninterruptibly();
Assert.assertFalse(futureRemove2b.isRemoved());
FutureGet futureGet3b = p2.get(lKey).contentKey(cKey).start();
futureGet3b.awaitUninterruptibly();
Assert.assertTrue(futureGet3b.isSuccess());
// should have been not modified
Assert.assertEquals(testData1, (String) futureGet3b.data().object());
// remove with correct key pair
// ---------------------------------------------------------
FutureRemove futureRemove4 = p1.remove(lKey).contentKey(cKey)
.keyPair(keyPair1).start();
futureRemove4.awaitUninterruptibly();
Assert.assertTrue(futureRemove4.isRemoved());
FutureGet futureGet4a = p2.get(lKey).contentKey(cKey).start();
futureGet4a.awaitUninterruptibly();
Assert.assertFalse(futureGet4a.isSuccess());
// should have been removed
Assert.assertNull(futureGet4a.data());
FutureGet futureGet4b = p2.get(lKey).contentKey(cKey).start();
futureGet4b.awaitUninterruptibly();
Assert.assertFalse(futureGet4b.isSuccess());
// should have been removed
Assert.assertNull(futureGet4b.data()); |
<<<<<<<
=======
if (!(message.command() == RPC.Commands.PING.getNr() || message.command() == RPC.Commands.NEIGHBOR.getNr())
&& message.recipient().isRelayed() && message.sender().isRelayed()) {
// initiate the holepunching process
if (peerBean.holePunchInitiator() != null) {
handleHolePunch(futureResponse, message, channelCreator, idleUDPSeconds);
// the sendMechanics are done in the HolePuncher class.
// Therefore we must execute this return statement.
return;
} else {
LOG.debug("No hole punching possible, because There is no PeerNAT.");
}
}
// RTT calculation
futureResponse.startRTTMeasurement(true);
>>>>>>>
// RTT calculation
futureResponse.startRTTMeasurement(true);
<<<<<<<
case DIRECT:
channelFuture = channelCreator.createUDP(broadcast, handlers, futureResponse);
break;
case HOLEP:
if (peerBean.holePunchInitiator() != null) {
handleHolePunch(futureResponse, message, channelCreator, idleUDPSeconds, handler, broadcast, handlers, channelFuture);
// all the send mechanics are done in a
// AbstractHolePuncherStrategy class.
// Therefore we must execute this return statement.
return;
} else {
LOG.debug("No hole punching possible, because There is no PeerNAT. New Attempt with Relaying");
}
case RELAY:
try {
channelFuture = prepareRelaySendUDP(futureResponse, message, channelCreator, broadcast, handlers, channelFuture);
} catch (Exception e) {
e.printStackTrace();
return;
}
break;
case SELF:
sendSelf(futureResponse, message);
channelFuture = null;
break;
default:
throw new IllegalArgumentException("UDP messages are not allowed to send over RCON");
=======
case DIRECT:
channelFuture = channelCreator.createUDP(broadcast, handlers, futureResponse);
break;
case RELAY:
List<PeerSocketAddress> psa = new ArrayList<PeerSocketAddress>(message.recipient().peerSocketAddresses());
LOG.debug("send neighbor request to random relay peer {}", psa);
if (!psa.isEmpty()) {
PeerSocketAddress ps = psa.get(random.nextInt(psa.size()));
message.recipientRelay(message.recipient().changePeerSocketAddress(ps)/*.changeRelayed(true)*/);
channelFuture = channelCreator.createUDP(broadcast, handlers, futureResponse);
} else {
futureResponse.failed("Peer is relayed, but no relay given");
return;
}
break;
case SELF:
sendSelf(futureResponse, message);
channelFuture = null;
break;
default:
throw new IllegalArgumentException("UDP messages are not allowed to send over RCON");
>>>>>>>
case DIRECT:
channelFuture = channelCreator.createUDP(broadcast, handlers, futureResponse);
break;
case HOLEP:
if (peerBean.holePunchInitiator() != null) {
handleHolePunch(futureResponse, message, channelCreator, idleUDPSeconds, handler, broadcast, handlers, channelFuture);
// all the send mechanics are done in a
// AbstractHolePuncherStrategy class.
// Therefore we must execute this return statement.
return;
} else {
LOG.debug("No hole punching possible, because There is no PeerNAT. New Attempt with Relaying");
}
case RELAY:
try {
channelFuture = prepareRelaySendUDP(futureResponse, message, channelCreator, broadcast, handlers, channelFuture);
} catch (Exception e) {
e.printStackTrace();
return;
}
break;
case SELF:
sendSelf(futureResponse, message);
channelFuture = null;
break;
default:
throw new IllegalArgumentException("UDP messages are not allowed to send over RCON"); |
<<<<<<<
/**
* Sets up connections to relay peers recursively. If the maximum number of
* relays is already reached, this method will do nothing.
*
* @param futureRelayConnections
* @param relayCandidates
* List of peers that could act as relays
* @param cc
* @param numberOfRelays
* The number of relays to establish.
* @param futureDone
* @return
*/
private FutureDone<Void> relaySetupLoop(final FutureDone<Void>[] futures, final LinkedHashSet<PeerAddress> relayCandidates, final ChannelCreator cc,
=======
//TODO: use List
private FutureDone<Void> relaySetupLoop(final FutureDone[] futureRelayConnections, final LinkedHashSet<PeerAddress> relayCandidates, final ChannelCreator cc,
>>>>>>>
/**
* Sets up connections to relay peers recursively. If the maximum number of
* relays is already reached, this method will do nothing.
*
* @param futureRelayConnections
* @param relayCandidates
* List of peers that could act as relays
* @param cc
* @param numberOfRelays
* The number of relays to establish.
* @param futureDone
* @return
*/
//TODO: use List
private FutureDone<Void> relaySetupLoop(final FutureDone[] futures, final LinkedHashSet<PeerAddress> relayCandidates, final ChannelCreator cc,
<<<<<<<
futures[i] = relayRPC.setupRelay(candidate, cc);
if (futures[i] != null) {
=======
final FuturePeerConnection fpc = peer.createPeerConnection(candidate);
futureRelayConnections[i] = relayRPC.setupRelay(cc, fpc);
if (futureRelayConnections[i] != null) {
>>>>>>>
final FuturePeerConnection fpc = peer.createPeerConnection(candidate);
futures[i] = relayRPC.setupRelay(cc, fpc);
if (futures[i] != null) {
<<<<<<<
FutureDone<Void> closeFuture = fr.futurePeerConnection().getObject().closeFuture();
closeFuture.addListener(new BaseFutureAdapter<FutureDone<Void>>() {
public void operationComplete(FutureDone<Void> future) throws Exception {
if (!peer.isShutdown()) {
// peer connection not open
// anymore -> remove and open a
// new relay connection
logger.debug("Relay " + fr.relayAddress() + " failed, setting up a new relay peer");
removeRelay(fr.relayAddress());
setupRelays();
futureDone.setDone();
}
}
});
=======
addCloseListener(peerConnection);
>>>>>>>
addCloseListener(peerConnection);
<<<<<<<
FutureDone<Void>[] relayConnectionFutures = new FutureDone[nrOfRelays];
=======
FutureDone[] relayConnectionFutures = new FutureDone[nrOfRelays];
>>>>>>>
FutureDone[] relayConnectionFutures = new FutureDone[nrOfRelays]; |
<<<<<<<
@Override
public Collection<Number160> findPeerIDsForResponsibleContent(Number160 locationKey) {
return storageMemoryReplication.findPeerIDsForResponsibleContent(locationKey);
=======
public Number160 findPeerIDForResponsibleContent(Number160 locationKey) {
return storageMemoryReplication.findPeerIDForResponsibleContent(locationKey);
>>>>>>>
public Collection<Number160> findPeerIDsForResponsibleContent(Number160 locationKey) {
return storageMemoryReplication.findPeerIDsForResponsibleContent(locationKey); |
<<<<<<<
import net.tomp2p.connection.ChannelCreator;
import net.tomp2p.futures.FutureChannelCreator;
import net.tomp2p.futures.FutureResponse;
import net.tomp2p.p2p.PeerBuilder;
import net.tomp2p.peers.Number160;
import net.tomp2p.peers.PeerAddress;
import net.tomp2p.rpc.SimpleBloomFilter;
import org.junit.Assert;
import org.junit.Test;
=======
>>>>>>>
import net.tomp2p.connection.ChannelCreator;
import net.tomp2p.connection.DefaultConnectionConfiguration;
import net.tomp2p.futures.FutureChannelCreator;
import net.tomp2p.futures.FutureResponse;
import net.tomp2p.p2p.Peer;
import net.tomp2p.p2p.PeerBuilder;
import net.tomp2p.peers.Number160;
import net.tomp2p.peers.PeerAddress;
import net.tomp2p.rpc.SimpleBloomFilter;
import net.tomp2p.storage.Data;
import net.tomp2p.tracker.AddTrackerBuilder;
import net.tomp2p.tracker.GetTrackerBuilder;
import net.tomp2p.utils.Utils;
import org.junit.Assert;
import org.junit.Test; |
<<<<<<<
Replication replication = new Replication(s1, master.getPeerAddress(), master.getPeerBean()
.peerMap(), replicatioFactor, false);
=======
Replication replication = new Replication(new StorageLayer(s1), master.getPeerAddress(), master.getPeerBean()
.peerMap(), replicatioFactor);
>>>>>>>
Replication replication = new Replication(new StorageLayer(s1), master.getPeerAddress(), master.getPeerBean()
.peerMap(), replicatioFactor, false);
<<<<<<<
Replication replication = new Replication(s1, master.getPeerAddress(), master.getPeerBean()
.peerMap(), replicatioFactor, false);
=======
Replication replication = new Replication(new StorageLayer(s1), master.getPeerAddress(), master.getPeerBean()
.peerMap(), replicatioFactor);
>>>>>>>
Replication replication = new Replication(new StorageLayer(s1), master.getPeerAddress(), master.getPeerBean()
.peerMap(), replicatioFactor, false); |
<<<<<<<
// this map caches all messages which are meant to be sent by a reverse
=======
// this map caches all messages which are meant to be sent by a reverse connection setup
>>>>>>>
// this map caches all messages which are meant to be sent by a reverse
<<<<<<<
final ChannelClientConfiguration channelClientConfiguration, Dispatcher dispatcher) {
=======
final ChannelClientConfiguration channelClientConfiguration, Dispatcher dispatcher, SendBehavior sendBehavior) {
>>>>>>>
final ChannelClientConfiguration channelClientConfiguration, Dispatcher dispatcher, SendBehavior sendBehavior) {
<<<<<<<
// we need to set the neighbors if we use relays
if (message.sender().isRelayed() && !message.sender().peerSocketAddresses().isEmpty()) {
message.peerSocketAddresses(message.sender().peerSocketAddresses());
}
=======
>>>>>>>
<<<<<<<
} else {
handleRelay(handler, futureResponse, message, channelCreator, idleTCPSeconds, connectTimeoutMillis, peerConnection,
=======
break;
case RELAY:
handleRelay(handler, futureResponse, message, channelCreator, idleTCPSeconds, connectTimeoutMillis, peerConnection,
>>>>>>>
break;
case RELAY:
handleRelay(handler, futureResponse, message, channelCreator, idleTCPSeconds, connectTimeoutMillis, peerConnection,
<<<<<<<
=======
>>>>>>>
<<<<<<<
readyToSend(message, socketAddress, socketInfoMessage, RPC.Commands.HOLEP.getNr(), Message.Type.REQUEST_1);
List<PeerSocketAddress> peerSocketAddresses = new ArrayList<PeerSocketAddress>();
for (SocketAddress soAddress : socketAddresses) {
InetSocketAddress inetSoAddress = (InetSocketAddress) soAddress;
PeerSocketAddress peerSocketAddress = new PeerSocketAddress(inetSoAddress.getAddress(), -1, inetSoAddress.getPort());
peerSocketAddresses.add(peerSocketAddress);
}
// make sure the other peer knows our peerSocketAddresses!
socketInfoMessage.peerSocketAddresses().clear();
socketInfoMessage.peerSocketAddresses(peerSocketAddresses);
// store the destination point to the message
return socketInfoMessage;
=======
PeerAddress recipient = message.recipient().changeAddress(socketAddress.inetAddress())
.changePorts(socketAddress.tcpPort(), socketAddress.udpPort()).changeRelayed(false);
rconMessage.recipient(recipient);
rconMessage.command(RPC.Commands.RCON.getNr());
rconMessage.type(Message.Type.REQUEST_1);
return rconMessage;
>>>>>>>
readyToSend(message, socketAddress, rconMessage, RPC.Commands.RCON.getNr(), Message.Type.REQUEST_1);
return rconMessage;
}
private static void readyToSend(final Message originalMessage, PeerSocketAddress socketAddress, Message newMessage, byte RPCCommand,
Type messageType) {
PeerAddress recipient = originalMessage.recipient().changeAddress(socketAddress.inetAddress())
.changePorts(socketAddress.tcpPort(), socketAddress.udpPort()).changeRelayed(false);
newMessage.recipient(recipient);
newMessage.command(RPCCommand);
newMessage.type(messageType);
}
private static PeerSocketAddress extractRandomRelay(final Message message) {
Object[] relayInetAdresses = message.recipient().peerSocketAddresses().toArray();
PeerSocketAddress socketAddress = null;
if (relayInetAdresses.length > 0) {
// we should be fair and choose one of the relays randomly
socketAddress = (PeerSocketAddress) relayInetAdresses[Utils.randomPositiveInt(relayInetAdresses.length)];
} else {
throw new IllegalArgumentException(
"There are no PeerSocketAdresses available for this relayed Peer. This should not be possible!");
}
return socketAddress;
}
private static Message createSocketInfoMessage(final Message message, List<SocketAddress> socketAddresses) {
PeerSocketAddress socketAddress = extractRandomRelay(message);
// we need to make a copy of the original Message
Message socketInfoMessage = new Message();
socketInfoMessage.messageId(message.messageId());
socketInfoMessage.sender(message.sender());
socketInfoMessage.version(message.version());
socketInfoMessage.udp(true);
// making the message ready to send
readyToSend(message, socketAddress, socketInfoMessage, RPC.Commands.HOLEP.getNr(), Message.Type.REQUEST_1);
List<PeerSocketAddress> peerSocketAddresses = new ArrayList<PeerSocketAddress>();
for (SocketAddress soAddress : socketAddresses) {
InetSocketAddress inetSoAddress = (InetSocketAddress) soAddress;
PeerSocketAddress peerSocketAddress = new PeerSocketAddress(inetSoAddress.getAddress(), -1, inetSoAddress.getPort());
peerSocketAddresses.add(peerSocketAddress);
}
// make sure the other peer knows our peerSocketAddresses!
socketInfoMessage.peerSocketAddresses().clear();
socketInfoMessage.peerSocketAddresses(peerSocketAddresses);
// store the destination point to the message
return socketInfoMessage;
<<<<<<<
=======
*
>>>>>>> refs/remotes/tomp2p/master
*
* @param handler
* @param futureResponse
* @param message
* @param channelCreator
* @param idleTCPSeconds
* @param connectTimeoutMillis
* @param peerConnection
* @param timeoutHandler
*/
private void handleRelay(final SimpleChannelInboundHandler<Message> handler, final FutureResponse futureResponse,
<<<<<<< /mnt/batch/tasks/workitems/adfv2-General_1/job-1/4e752bfa-de61-41d3-bad2-15740ed8a990/wd/.temp/athenacommon/a3755370-fd75-4e7d-8fc1-0223491c727f.java
final Message message, final ChannelCreator channelCreator, final int idleTCPSeconds, final int connectTimeoutMillis,
final PeerConnection peerConnection, final TimeoutFactory timeoutHandler) {
FutureDone<PeerSocketAddress> futurePing = pingFirst(message.recipient().peerSocketAddresses(), pingBuilderFactory);
=======
final Message message, final ChannelCreator channelCreator, final int idleTCPSeconds,
final int connectTimeoutMillis, final PeerConnection peerConnection, final TimeoutFactory timeoutHandler) {
FutureDone<PeerSocketAddress> futurePing = pingFirst(message.recipient().peerSocketAddresses());
>>>>>>>
*
*
* @param handler
* @param futureResponse
* @param message
* @param channelCreator
* @param idleTCPSeconds
* @param connectTimeoutMillis
* @param peerConnection
* @param timeoutHandler
*/
private void handleRelay(final SimpleChannelInboundHandler<Message> handler, final FutureResponse futureResponse,
final Message message, final ChannelCreator channelCreator, final int idleTCPSeconds,
final int connectTimeoutMillis, final PeerConnection peerConnection, final TimeoutFactory timeoutHandler) {
FutureDone<PeerSocketAddress> futurePing = pingFirst(message.recipient().peerSocketAddresses());
<<<<<<<
if (future.responseMessage() != null && future.responseMessage().type() != Message.Type.USER1) {
=======
if (future.responseMessage() != null && future.responseMessage().type() != Message.Type.DENIED) {
// remove the failed relay and try again
>>>>>>>
if (future.responseMessage() != null && future.responseMessage().type() != Message.Type.DENIED) {
// remove the failed relay and try again
<<<<<<<
private FutureDone<PeerSocketAddress> pingFirst(Collection<PeerSocketAddress> peerSocketAddresses, PingBuilderFactory pingBuilderFactory) {
=======
private FutureDone<PeerSocketAddress> pingFirst(Collection<PeerSocketAddress> peerSocketAddresses) {
>>>>>>>
private FutureDone<PeerSocketAddress> pingFirst(Collection<PeerSocketAddress> peerSocketAddresses) {
<<<<<<<
ChannelFuture channelFuture = channelCreator.createTCP(recipient, connectTimeoutMillis, handlers, futureResponse);
=======
ChannelFuture channelFuture = channelCreator.createTCP(reflectedRecipient, connectTimeoutMillis, handlers, futureResponse);
>>>>>>>
ChannelFuture channelFuture = channelCreator.createTCP(reflectedRecipient, connectTimeoutMillis, handlers, futureResponse);
<<<<<<<
if (message.sender().isRelayed()) {
message.peerSocketAddresses(message.sender().peerSocketAddresses());
}
if (message.command() == RPC.Commands.DIRECT_DATA.getNr() && message.recipient().isRelayed() && message.sender().isRelayed()) {
try {
channelCreators = prepareHolePunch(futureResponse, message);
} catch (Exception e) {
e.printStackTrace();
}
// extract the socketAddresses of the channelCreators
final List<SocketAddress> socketAddresses = new ArrayList<SocketAddress>();
for (ChannelCreator cc : channelCreators) {
cc.bindHole();
socketAddresses.add(cc.currentSocketAddress());
cachedChannelCreators.put(message.messageId(), cc);
}
// initiate the rendezvous process
initHolePunch(createSocketInfoMessage(message, socketAddresses), channelCreator, idleUDPSeconds, futureResponse, broadcast,
message, handler);
return;
} else {
channelCreators = null;
}
=======
>>>>>>>
if (message.sender().isRelayed()) {
message.peerSocketAddresses(message.sender().peerSocketAddresses());
}
if (message.command() == RPC.Commands.DIRECT_DATA.getNr() && message.recipient().isRelayed() && message.sender().isRelayed()) {
try {
channelCreators = prepareHolePunch(futureResponse, message);
} catch (Exception e) {
e.printStackTrace();
}
// extract the socketAddresses of the channelCreators
final List<SocketAddress> socketAddresses = new ArrayList<SocketAddress>();
for (ChannelCreator cc : channelCreators) {
cc.bindHole();
socketAddresses.add(cc.currentSocketAddress());
cachedChannelCreators.put(message.messageId(), cc);
}
// initiate the rendezvous process
initHolePunch(createSocketInfoMessage(message, socketAddresses), channelCreator, idleUDPSeconds, futureResponse, broadcast,
message, handler);
return;
} else {
channelCreators = null;
} |
<<<<<<<
import net.tomp2p.peers.PeerStatatistic;
import net.tomp2p.utils.MessageUtils;
=======
import net.tomp2p.peers.PeerStatistic;
import net.tomp2p.storage.AlternativeCompositeByteBuf;
>>>>>>>
import net.tomp2p.peers.PeerStatistic;
import net.tomp2p.utils.MessageUtils; |
<<<<<<<
=======
import net.tomp2p.futures.BaseFutureAdapter;
import net.tomp2p.futures.FutureDone;
import net.tomp2p.futures.FuturePeerConnection;
import net.tomp2p.futures.FutureResponse;
>>>>>>>
<<<<<<<
/**
* An android device is behind a firewall and wants to be relayed
*/
private void handleSetupAndroid(Message message, final PeerConnection peerConnection, Responder responder) {
Buffer buffer = message.buffer(0);
if(buffer == null || buffer.buffer() == null) {
LOG.error("Device {} did not send any GCM registration id", peerConnection.remotePeer());
responder.response(createResponseMessage(message, Type.DENIED));
return;
}
String registrationId = RelayUtils.decodeRegistrationId(buffer);
if(registrationId == null) {
LOG.error("Cannot decode the registrationID from the message");
responder.response(createResponseMessage(message, Type.DENIED));
return;
}
if(gcmAuthToken == null) {
LOG.error("This relay peer is not capable to serve Android devices");
responder.response(createResponseMessage(message, Type.DENIED));
return;
}
LOG.debug("Hello Android device! You'll be relayed over GCM. {}", message);
AndroidForwarderRPC forwarderRPC = new AndroidForwarderRPC(peer, peerConnection, gcmAuthToken, registrationId);
registerRelayForwarder(forwarderRPC);
}
private void registerRelayForwarder(BaseRelayForwarderRPC forwarder) {
for (Commands command : RPC.Commands.values()) {
if(command == RPC.Commands.RCON) {
// We must register the rconRPC for every unreachable peer that
// we serve as a relay. Without this registration, no reverse
// connection setup is possible.
peer.connectionBean().dispatcher()
.registerIoHandler(forwarder.unreachablePeerId(), rconRPC, command.getNr());
} else if (command == RPC.Commands.RELAY) {
// don't register the relay command
continue;
} else {
peer.connectionBean().dispatcher().registerIoHandler(forwarder.unreachablePeerId(), forwarder, command.getNr());
}
}
peer.peerBean().addPeerStatusListeners(forwarder);
forwarders.put(forwarder.unreachablePeerId(), forwarder);
}
private void handlePiggyBackedMessage(Message message, Responder responderToRelay) throws Exception {
=======
private void handlePiggyBackMessage(Message message, final Responder responderToRelay) throws Exception {
>>>>>>>
/**
* An android device is behind a firewall and wants to be relayed
*/
private void handleSetupAndroid(Message message, final PeerConnection peerConnection, Responder responder) {
Buffer buffer = message.buffer(0);
if(buffer == null || buffer.buffer() == null) {
LOG.error("Device {} did not send any GCM registration id", peerConnection.remotePeer());
responder.response(createResponseMessage(message, Type.DENIED));
return;
}
String registrationId = RelayUtils.decodeRegistrationId(buffer);
if(registrationId == null) {
LOG.error("Cannot decode the registrationID from the message");
responder.response(createResponseMessage(message, Type.DENIED));
return;
}
if(gcmAuthToken == null) {
LOG.error("This relay peer is not capable to serve Android devices");
responder.response(createResponseMessage(message, Type.DENIED));
return;
}
LOG.debug("Hello Android device! You'll be relayed over GCM. {}", message);
AndroidForwarderRPC forwarderRPC = new AndroidForwarderRPC(peer, peerConnection, gcmAuthToken, registrationId);
registerRelayForwarder(forwarderRPC);
}
private void registerRelayForwarder(BaseRelayForwarderRPC forwarder) {
for (Commands command : RPC.Commands.values()) {
if(command == RPC.Commands.RCON) {
// We must register the rconRPC for every unreachable peer that
// we serve as a relay. Without this registration, no reverse
// connection setup is possible.
peer.connectionBean().dispatcher()
.registerIoHandler(forwarder.unreachablePeerId(), rconRPC, command.getNr());
} else if (command == RPC.Commands.RELAY) {
// don't register the relay command
continue;
} else {
peer.connectionBean().dispatcher().registerIoHandler(forwarder.unreachablePeerId(), forwarder, command.getNr());
}
}
peer.peerBean().addPeerStatusListeners(forwarder);
forwarders.put(forwarder.unreachablePeerId(), forwarder);
}
private void handlePiggyBackedMessage(Message message, final Responder responderToRelay) throws Exception {
<<<<<<<
NoDirectResponse responder = new NoDirectResponse();
=======
final Message response = createResponseMessage(message, Type.OK);
final Responder responder = new Responder() {
//TODO: add reply leak handler
@Override
public void response(Message responseMessage) {
LOG.debug("Send reply message to relay peer: {}", responseMessage);
try {
response.buffer(RelayUtils.encodeMessage(responseMessage));
} catch (Exception e) {
failed(Type.EXCEPTION, e.getMessage());
e.printStackTrace();
}
responderToRelay.response(response);
}
@Override
public void failed(Type type, String reason) {
responderToRelay.failed(type, reason);
}
@Override
public void responseFireAndForget() {
responderToRelay.responseFireAndForget();
}
};
>>>>>>>
final Message response = createResponseMessage(message, Type.OK);
final Responder responder = new Responder() {
//TODO: add reply leak handler
@Override
public void response(Message responseMessage) {
LOG.debug("Send reply message to relay peer: {}", responseMessage);
try {
response.buffer(RelayUtils.encodeMessage(responseMessage));
} catch (Exception e) {
LOG.error("Cannot piggyback the response", e);
failed(Type.EXCEPTION, e.getMessage());
}
responderToRelay.response(response);
}
@Override
public void failed(Type type, String reason) {
responderToRelay.failed(type, reason);
}
@Override
public void responseFireAndForget() {
responderToRelay.responseFireAndForget();
}
};
<<<<<<<
peer.connectionBean().dispatcher().associatedHandler(realMessage).handleResponse(realMessage, null, false, responder);
LOG.debug("Send reply message to relay peer: {}", responder.response());
Message response = createResponseMessage(message, Type.OK);
response.buffer(RelayUtils.encodeMessage(responder.response()));
responderToRelay.response(response);
=======
DispatchHandler dispatchHandler = peer.connectionBean().dispatcher().associatedHandler(realMessage);
if(dispatchHandler == null) {
responder.failed(Type.EXCEPTION, "handler not found, probably not relaying peer anymore");
} else {
dispatchHandler.handleResponse(realMessage, null, false, responder);
}
>>>>>>>
DispatchHandler dispatchHandler = peer.connectionBean().dispatcher().associatedHandler(realMessage);
if(dispatchHandler == null) {
responder.failed(Type.EXCEPTION, "handler not found, probably not relaying peer anymore");
} else {
dispatchHandler.handleResponse(realMessage, null, false, responder);
} |
<<<<<<<
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.TimeZone;
=======
import java.util.Arrays;
import java.util.List;
>>>>>>>
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.TimeZone;
<<<<<<<
=======
void execExpectList(String cmd, boolean expecteGoodExit, List<String> expectedStrings) throws IOException {
exec(cmd);
if (expecteGoodExit) {
assertGoodExit("", true);
} else {
assertBadExit("", true);
}
for (String expectedString : expectedStrings) {
assertTrue(expectedString + " was not present in " + output.get(), output.get().contains(expectedString));
}
}
>>>>>>>
void execExpectList(String cmd, boolean expecteGoodExit, List<String> expectedStrings) throws IOException {
exec(cmd);
if (expecteGoodExit) {
assertGoodExit("", true);
} else {
assertBadExit("", true);
}
for (String expectedString : expectedStrings) {
assertTrue(expectedString + " was not present in " + output.get(), output.get().contains(expectedString));
}
}
<<<<<<<
exec("getauths", true, "x,y,z");
=======
execExpectList("getauths", true, Arrays.asList("x", "y", "z"));
>>>>>>>
execExpectList("getauths", true, Arrays.asList("x", "y", "z"));
<<<<<<<
exec("getauths", true, "a,x,y,z");
=======
execExpectList("getauths", true, Arrays.asList("x", "y", "z", "a"));
>>>>>>>
execExpectList("getauths", true, Arrays.asList("x", "y", "z", "a")); |
<<<<<<<
import java.io.PrintWriter;
import java.io.UnsupportedEncodingException;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
=======
import java.util.ArrayList;
>>>>>>>
import java.util.ArrayList;
<<<<<<<
import java.util.Collection;
import java.util.Collections;
=======
>>>>>>>
<<<<<<<
import io.github.classgraph.ClassInfo;
import io.github.classgraph.ClassInfoList;
import io.github.classgraph.ClassRefTypeSignature;
import io.github.classgraph.MethodInfo;
import io.github.classgraph.MethodTypeSignature;
=======
>>>>>>>
<<<<<<<
static final String SERVLET_CONTAINER_INITIALIZER = "javax.servlet.ServletContainerInitializer";
static final String HANDLES_TYPES = "javax.servlet.annotation.HandlesTypes";
static final String MYFACES_ANNOTATION_PROVIDER = "org.apache.myfaces.spi.AnnotationProvider";
static final List<String> MYFACES_ANNOTATIONS = Collections.unmodifiableList(Arrays.asList(
"javax.faces.bean.ManagedBean",
"javax.faces.component.FacesComponent",
"javax.faces.component.behavior.FacesBehavior",
"javax.faces.convert.FacesConverter",
"javax.faces.event.NamedEvent",
"javax.faces.render.FacesRenderer",
"javax.faces.render.FacesBehaviorRenderer",
"javax.faces.validator.FacesValidator"
));
static final String REWRITE_ANNOTATION_HANDLER = "org.ocpsoft.rewrite.annotation.spi.AnnotationHandler";
=======
>>>>>>>
<<<<<<<
processHandlesTypes(scanResult);
processMyfacesAnnotationProvider(scanResult);
processRewriteAnnotationProvider(scanResult);
}
}
private void processRewriteAnnotationProvider(ScanResult scanResult) throws FileNotFoundException, UnsupportedEncodingException {
ClassInfoList annotationHandlers = scanResult.getClassesImplementing(REWRITE_ANNOTATION_HANDLER);
if (annotationHandlers.isEmpty()) {
return;
}
List<String> annotationClassNames = annotationHandlers.stream()
.map(classInfo -> classInfo.getDeclaredMethodInfo("handles"))
.flatMap(Collection::stream)
.map(MethodInfo::getTypeSignature)
.map(MethodTypeSignature::getResultType)
.filter(ClassRefTypeSignature.class::isInstance)
.map(ClassRefTypeSignature.class::cast)
.map(classRefTypeSignature -> classRefTypeSignature.getTypeArguments().get(0))
.map(TypeArgument::getTypeSignature)
.filter(ClassRefTypeSignature.class::isInstance)
.map(ClassRefTypeSignature.class::cast)
.map(ClassRefTypeSignature::getFullyQualifiedClassName)
.collect(Collectors.toList());
File resultFile = new File(getBaseDir(), REWRITE_ANNOTATION_HANDLER + ".classes");
try (PrintWriter printWriter = new PrintWriter(resultFile, "UTF-8")) {
for (String annotationClassName : annotationClassNames) {
printWriter.print(annotationClassName);
printWriter.print("=");
ClassInfoList classesWithAnnotation = scanResult.getClassesWithAnnotation(annotationClassName);
printWriter.println(String.join(",", classesWithAnnotation.getNames()));
}
}
}
private void processMyfacesAnnotationProvider(ScanResult scanResult) throws IOException {
if (scanResult.getClassInfo(MYFACES_ANNOTATION_PROVIDER) == null) {
return;
}
if (!getBaseDir().isDirectory() && !getBaseDir().mkdirs()) {
throw new IOException(getBaseDir() + " does not exist and could not be created");
}
File resultFile = new File(getBaseDir(), MYFACES_ANNOTATION_PROVIDER + ".classes");
//noinspection CharsetObjectCanBeUsed
try (PrintWriter printWriter = new PrintWriter(resultFile, "UTF-8")) {
for (String myfacesAnnotation : MYFACES_ANNOTATIONS) {
printWriter.print(myfacesAnnotation);
printWriter.print("=");
ClassInfoList classesWithAnnotation = scanResult.getClassesWithAnnotation(myfacesAnnotation);
printWriter.println(String.join(",", classesWithAnnotation.getNames()));
=======
for (ScanResultHandler scanResultHandler : this.scanResultHandlers) {
scanResultHandler.handle(scanResult, getBaseDir());
>>>>>>>
for (ScanResultHandler scanResultHandler : this.scanResultHandlers) {
scanResultHandler.handle(scanResult, getBaseDir()); |
<<<<<<<
public void removeLoginToken(String email) {
getOptionalSingleResult(
entityManager.createNamedQuery("Credentials.getByEmail", Credentials.class).setParameter("email", email)
).getUser().setLoginToken(null);
}
=======
>>>>>>>
public void removeLoginToken(String email) {
getOptionalSingleResult(
entityManager.createNamedQuery("Credentials.getByEmail", Credentials.class).setParameter("email", email)
).getUser().setLoginToken(null);
} |
<<<<<<<
import cm.aptoide.pt.appview.UserPreferencesPersister;
import cm.aptoide.pt.autoupdate.AutoUpdateService;
=======
import cm.aptoide.pt.appview.PreferencesPersister;
>>>>>>>
import cm.aptoide.pt.appview.PreferencesPersister;
import cm.aptoide.pt.autoupdate.AutoUpdateService;
<<<<<<<
@Singleton @Provides @Named("retrofit-autoUpdate") Retrofit providesAutoUpdateRetrofit(
@Named("default") OkHttpClient httpClient, @Named("autoUpdateBaseHost") String baseHost,
Converter.Factory converterFactory, @Named("rx") CallAdapter.Factory rxCallAdapterFactory) {
return new Retrofit.Builder().baseUrl(baseHost)
.client(httpClient)
.addCallAdapterFactory(rxCallAdapterFactory)
.addConverterFactory(converterFactory)
.build();
}
@Singleton @Provides @Named("autoUpdateBaseHost") String providesAutoUpdateBaseHost() {
return "http://imgs.aptoide.com/";
}
=======
@Singleton @Provides PromotionsPreferencesManager providesPromotionsPreferencesManager(
PreferencesPersister persister) {
return new PromotionsPreferencesManager(persister);
}
@Singleton @Provides PromotionsAnalytics providesPromotionsAnalytics(
AnalyticsManager analyticsManager, NavigationTracker navigationTracker,
DownloadAnalytics downloadAnalytics) {
return new PromotionsAnalytics(analyticsManager, navigationTracker, downloadAnalytics);
}
>>>>>>>
@Singleton @Provides PromotionsPreferencesManager providesPromotionsPreferencesManager(
PreferencesPersister persister) {
return new PromotionsPreferencesManager(persister);
}
@Singleton @Provides PromotionsAnalytics providesPromotionsAnalytics(
AnalyticsManager analyticsManager, NavigationTracker navigationTracker,
DownloadAnalytics downloadAnalytics) {
return new PromotionsAnalytics(analyticsManager, navigationTracker, downloadAnalytics);
}
@Singleton @Provides @Named("retrofit-autoUpdate") Retrofit providesAutoUpdateRetrofit(
@Named("default") OkHttpClient httpClient, @Named("autoUpdateBaseHost") String baseHost,
Converter.Factory converterFactory, @Named("rx") CallAdapter.Factory rxCallAdapterFactory) {
return new Retrofit.Builder().baseUrl(baseHost)
.client(httpClient)
.addCallAdapterFactory(rxCallAdapterFactory)
.addConverterFactory(converterFactory)
.build();
}
@Singleton @Provides @Named("autoUpdateBaseHost") String providesAutoUpdateBaseHost() {
return "http://imgs.aptoide.com/";
} |
<<<<<<<
import cm.aptoide.pt.database.accessors.AccessorFactory;
import cm.aptoide.pt.database.realm.Store;
import cm.aptoide.pt.database.realm.Update;
=======
import cm.aptoide.pt.crashreports.CrashReports;
import cm.aptoide.pt.database.accessors.DeprecatedDatabase;
>>>>>>>
import cm.aptoide.pt.crashreports.CrashReports;
import cm.aptoide.pt.database.accessors.AccessorFactory;
import cm.aptoide.pt.database.realm.Store;
import cm.aptoide.pt.database.realm.Update;
<<<<<<<
=======
import io.realm.Realm;
>>>>>>> |
<<<<<<<
import cm.aptoide.pt.v8engine.download.DownloadFactory;
import cm.aptoide.pt.v8engine.install.InstalledRepository;
=======
import cm.aptoide.pt.v8engine.app.AppViewAnalytics;
import cm.aptoide.pt.v8engine.install.rollback.RollbackRepository;
import cm.aptoide.pt.v8engine.repository.InstalledRepository;
import cm.aptoide.pt.v8engine.repository.RepositoryFactory;
import cm.aptoide.pt.v8engine.timeline.TimelineAnalytics;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import lombok.AccessLevel;
>>>>>>>
import cm.aptoide.pt.v8engine.app.AppViewAnalytics;
import cm.aptoide.pt.v8engine.download.DownloadFactory;
import cm.aptoide.pt.v8engine.install.InstalledRepository;
import cm.aptoide.pt.v8engine.timeline.TimelineAnalytics;
<<<<<<<
private DownloadFactory downloadFactory;
=======
private WidgetState widgetState;
private GetAppMeta.App currentApp;
private TimelineAnalytics timelineAnalytics;
>>>>>>>
private DownloadFactory downloadFactory;
private TimelineAnalytics timelineAnalytics;
<<<<<<<
MinimalAd minimalAd, boolean shouldInstall, InstalledRepository installedRepository,
DownloadFactory downloadFactory) {
super(getApp);
=======
MinimalAd minimalAd, boolean shouldInstall, InstalledRepository installedRepository,
TimelineAnalytics timelineAnalytics, AppViewAnalytics appViewAnalytics) {
super(getApp, appViewAnalytics);
>>>>>>>
MinimalAd minimalAd, boolean shouldInstall, InstalledRepository installedRepository,
DownloadFactory downloadFactory, TimelineAnalytics timelineAnalytics,
AppViewAnalytics appViewAnalytics) {
super(getApp, appViewAnalytics);
<<<<<<<
this.downloadFactory = downloadFactory;
=======
this.rollbackRepository = RepositoryFactory.getRollbackRepository();
this.installedRepository = installedRepository;
this.timelineAnalytics = timelineAnalytics;
widgetState = new WidgetState(ACTION_NO_STATE);
>>>>>>>
this.downloadFactory = downloadFactory;
this.timelineAnalytics = timelineAnalytics;
<<<<<<<
MinimalAd minimalAd, boolean shouldInstall, InstalledRepository installedRepository,
DownloadFactory downloadFactory) {
=======
MinimalAd minimalAd, boolean shouldInstall, InstalledRepository installedRepository,
TimelineAnalytics timelineAnalytics, AppViewAnalytics appViewAnalytics) {
>>>>>>>
MinimalAd minimalAd, boolean shouldInstall, InstalledRepository installedRepository,
DownloadFactory downloadFactory, TimelineAnalytics timelineAnalytics,
AppViewAnalytics appViewAnalytics) {
<<<<<<<
installedRepository, downloadFactory);
=======
installedRepository, timelineAnalytics, appViewAnalytics);
>>>>>>>
installedRepository, downloadFactory, timelineAnalytics, appViewAnalytics);
<<<<<<<
public Single<InstallManager.Error> getError() {
return installManager.getError(md5);
=======
public Observable<WidgetState> getState() {
return getInstallationObservable(md5, installManager).flatMap(state -> {
if (state.getButtonState() == ACTION_NO_STATE) {
return getInstalledAppObservable(currentApp, installedRepository);
} else {
return Observable.just(state);
}
});
}
private Observable<WidgetState> getInstallationObservable(String md5,
InstallManager installManager) {
return installManager.getAsListInstallation(md5)
.map(progress -> {
if (progress != null && progress.getState() != Progress.DONE && (progress.getState()
== Progress.ACTIVE
|| progress.getRequest()
.getOverallDownloadStatus() == Download.PAUSED)) {
widgetState.setButtonState(ACTION_INSTALLING);
} else {
widgetState.setButtonState(ACTION_NO_STATE);
}
widgetState.setProgress(progress);
return widgetState;
});
}
@NonNull private Observable<WidgetState> getInstalledAppObservable(GetAppMeta.App currentApp,
InstalledRepository installedRepository) {
return installedRepository.getAsList(currentApp.getPackageName())
.map(installeds -> {
if (installeds != null && installeds.size() > 0) {
Installed installed = installeds.get(0);
if (currentApp.getFile()
.getVercode() == installed.getVersionCode()) {
widgetState.setButtonState(ACTION_OPEN);
} else if (currentApp.getFile()
.getVercode() <= installed.getVersionCode()) {
widgetState.setButtonState(ACTION_DOWNGRADE);
} else if (currentApp.getFile()
.getVercode() >= installed.getVersionCode()) {
widgetState.setButtonState(ACTION_UPDATE);
}
} else {
widgetState.setButtonState(ACTION_INSTALL);
}
return widgetState;
});
}
public TimelineAnalytics getTimelineAnalytics() {
return timelineAnalytics;
}
@IntDef({
ACTION_INSTALL, ACTION_UPDATE, ACTION_DOWNGRADE, ACTION_OPEN, ACTION_INSTALLING,
ACTION_NO_STATE
})
@Retention(RetentionPolicy.SOURCE)
public @interface ButtonState {
}
public class WidgetState {
private @Setter(AccessLevel.PRIVATE) @ButtonState int buttonState;
private @Setter(AccessLevel.PRIVATE) @Getter @Nullable Progress<Download> progress;
public WidgetState(int buttonState) {
this.buttonState = buttonState;
}
public @ButtonState int getButtonState() {
return buttonState;
}
>>>>>>>
public Single<InstallManager.Error> getError() {
return installManager.getError(md5);
}
public TimelineAnalytics getTimelineAnalytics() {
return timelineAnalytics; |
<<<<<<<
Observable<GetPullNotificationsResponse> getPushNotifications(@FieldMap BaseBody arg,
@Header(PostCacheInterceptor.BYPASS_HEADER_KEY) boolean bypassCache);
=======
Observable<GetPushNotificationsResponse> getPushNotifications(@FieldMap BaseBody arg,
@Header(WebService.BYPASS_HEADER_KEY) boolean bypassCache);
>>>>>>>
Observable<GetPullNotificationsResponse> getPushNotifications(@FieldMap BaseBody arg,
@Header(WebService.BYPASS_HEADER_KEY) boolean bypassCache); |
<<<<<<<
AptoideUtils.StringU.getResString(R.string.error_MARG_107, getContext().getResources());
timelineAnalytics =
((AptoideApplication) getContext().getApplicationContext()).getTimelineAnalytics();
=======
AptoideUtils.StringU.getResString(R.string.ws_error_MARG_107, getContext().getResources());
Analytics analytics = Analytics.getInstance();
timelineAnalytics = new TimelineAnalytics(analytics,
AppEventsLogger.newLogger(getContext().getApplicationContext()),
application.getAccountSettingsBodyInterceptorPoolV7(), httpClient, converterFactory,
tokenInvalidator, BuildConfig.APPLICATION_ID, application.getDefaultSharedPreferences(),
application.getNotificationAnalytics(), application.getNavigationTracker(),
application.getReadPostsPersistence());
>>>>>>>
AptoideUtils.StringU.getResString(R.string.ws_error_MARG_107, getContext().getResources());
timelineAnalytics =
((AptoideApplication) getContext().getApplicationContext()).getTimelineAnalytics(); |
<<<<<<<
String aptoideClientUUID, boolean googlePlayServicesAvailable, String oemid, boolean mature) {
=======
String aptoideClientUuid, boolean googlePlayServicesAvailable, String oemid) {
>>>>>>>
String aptoideClientUuid, boolean googlePlayServicesAvailable, String oemid, boolean mature) {
<<<<<<<
ioScheduler(
GetAdsRequest.ofHomepage(aptoideClientUUID, googlePlayServicesAvailable, oemid,
mature)
.observe()).subscribe(
getAdsResponse -> setObjectView(wsWidget, countDownLatch, getAdsResponse), action1);
=======
GetAdsRequest.ofHomepage(aptoideClientUuid, googlePlayServicesAvailable, oemid)
.observe()
.compose(AptoideUtils.ObservableU.applySchedulers())
.subscribe(getAdsResponse -> setObjectView(wsWidget, countDownLatch, getAdsResponse),
action1);
>>>>>>>
GetAdsRequest.ofHomepage(aptoideClientUuid, googlePlayServicesAvailable, oemid, mature)
.observe()
.compose(AptoideUtils.ObservableU.applySchedulers())
.subscribe(getAdsResponse -> setObjectView(wsWidget, countDownLatch, getAdsResponse),
action1); |
<<<<<<<
AppViewManager appViewManager, AptoideAccountManager accountManager, Scheduler scheduler,
CrashReport crashReport) {
=======
AppViewManager appViewManager, AptoideAccountManager accountManager, Scheduler viewScheduler,
CrashReport crashReport, long appId, String packageName, PermissionManager permissionManager,
PermissionService permissionService) {
>>>>>>>
AppViewManager appViewManager, AptoideAccountManager accountManager, Scheduler viewScheduler,
CrashReport crashReport, PermissionManager permissionManager,
PermissionService permissionService) {
<<<<<<<
=======
this.appId = appId;
this.packageName = packageName;
this.permissionManager = permissionManager;
this.permissionService = permissionService;
>>>>>>>
this.permissionManager = permissionManager;
this.permissionService = permissionService;
<<<<<<<
.flatMapSingle(__ -> appViewManager.loadAppViewViewModel())
.observeOn(scheduler)
=======
.flatMapSingle(__ -> appViewManager.getDetailedAppViewModel(appId, packageName))
.observeOn(viewScheduler)
>>>>>>>
.flatMapSingle(__ -> appViewManager.loadAppViewViewModel())
.observeOn(viewScheduler)
<<<<<<<
.flatMapSingle(__ -> appViewManager.loadAppViewViewModel())
.observeOn(scheduler)
=======
.flatMapSingle(__ -> appViewManager.getDetailedAppViewModel(appId, packageName))
.observeOn(viewScheduler)
>>>>>>>
.flatMapSingle(__ -> appViewManager.loadAppViewViewModel())
.observeOn(viewScheduler)
<<<<<<<
.flatMapSingle(__ -> appViewManager.loadAppViewViewModel())
.observeOn(scheduler)
=======
.flatMapSingle(__ -> appViewManager.getDetailedAppViewModel(appId, packageName))
.observeOn(viewScheduler)
>>>>>>>
.flatMapSingle(__ -> appViewManager.loadAppViewViewModel())
.observeOn(viewScheduler)
<<<<<<<
.flatMapSingle(__ -> appViewManager.loadAppViewViewModel())
.observeOn(scheduler)
=======
.flatMapSingle(__ -> appViewManager.getDetailedAppViewModel(appId, packageName))
.observeOn(viewScheduler)
>>>>>>>
.flatMapSingle(__ -> appViewManager.loadAppViewViewModel())
.observeOn(viewScheduler)
<<<<<<<
return appViewManager.loadAppViewViewModel()
=======
return appViewManager.getDetailedAppViewModel(appId, packageName)
.flatMap(detailedAppViewModel -> appViewManager.getDownloadAppViewModel(
detailedAppViewModel.getMd5(), detailedAppViewModel.getPackageName(),
detailedAppViewModel.getVerCode())
.first()
.observeOn(viewScheduler)
.doOnNext(downloadAppViewModel -> view.showDownloadAppModel(downloadAppViewModel))
.doOnNext(downloadAppViewModel -> view.readyToDownload())
.toSingle()
.map(downloadAppViewModel -> detailedAppViewModel))
>>>>>>>
return appViewManager.loadAppViewViewModel()
.flatMap(detailedAppViewModel -> appViewManager.getDownloadAppViewModel(
detailedAppViewModel.getMd5(), detailedAppViewModel.getPackageName(),
detailedAppViewModel.getVerCode())
.first()
.observeOn(viewScheduler)
.doOnNext(downloadAppViewModel -> view.showDownloadAppModel(downloadAppViewModel))
.doOnNext(downloadAppViewModel -> view.readyToDownload())
.toSingle()
.map(downloadAppViewModel -> detailedAppViewModel))
<<<<<<<
.getName(), appViewModel.getPackageName(), 5, view.getLanguageFilter())
.observeOn(scheduler), appViewManager.loadSimilarApps(appViewModel.getPackageName(),
=======
.getName(), packageName, 5, view.getLanguageFilter())
.observeOn(viewScheduler), appViewManager.loadSimilarApps(packageName,
>>>>>>>
.getName(), appViewModel.getPackageName(), 5, view.getLanguageFilter())
.observeOn(viewScheduler), appViewManager.loadSimilarApps(packageName, |
<<<<<<<
import rx.Observable;
=======
import io.realm.Realm;
import lombok.Cleanup;
import rx.Subscription;
>>>>>>>
import io.realm.Realm;
import lombok.Cleanup;
import rx.Subscription;
import rx.Observable;
<<<<<<<
private CompositeSubscription subscriptions;
private boolean isUpdate;
=======
private boolean setupDownloadControlsRunned = false;
private boolean resumeButtonWasClicked = false;
//private Subscription subscribe;
//private long appID;
>>>>>>>
private CompositeSubscription subscriptions;
private boolean isUpdate;
private boolean setupDownloadControlsRunned = false;
private boolean resumeButtonWasClicked = false;
//private Subscription subscribe;
//private long appID;
<<<<<<<
subscriptions.unsubscribe();
=======
//subscribe.unsubscribe();
>>>>>>>
//subscribe.unsubscribe(); |
<<<<<<<
=======
import cm.aptoide.accountmanager.AptoideAccountManager;
import cm.aptoide.pt.annotation.Partners;
import cm.aptoide.pt.crashreports.CrashReport;
>>>>>>>
import cm.aptoide.accountmanager.AptoideAccountManager;
import cm.aptoide.pt.annotation.Partners;
import cm.aptoide.pt.crashreports.CrashReport;
<<<<<<<
=======
registerReceiverForAccountManager();
>>>>>>>
<<<<<<<
=======
unregisterReceiverForAccountManager();
super.onDestroyView();
}
private void unregisterReceiverForAccountManager() {
try {
getContext().unregisterReceiver(receiver);
} catch (IllegalArgumentException ex) {
CrashReport.getInstance().log(ex);
}
>>>>>>> |
<<<<<<<
import cm.aptoide.pt.downloadmanager.DownloadServiceHelper;
=======
import cm.aptoide.pt.model.v7.Type;
import cm.aptoide.pt.v8engine.InstallManager;
import cm.aptoide.pt.v8engine.Progress;
>>>>>>>
import cm.aptoide.pt.v8engine.InstallManager;
import cm.aptoide.pt.v8engine.Progress;
<<<<<<<
@Override protected Configs getConfig() {
return new Configs(1, false);
}
=======
/**
* * <dt><b>Scheduler:</b></dt>
* <dd>{@code getUpdates} operates by default on the {@code io} {@link Scheduler}..</dd>
* </dl>
*/
public Observable<Progress<Download>> getUpdates() {
return installManager.getInstallations();
}
public boolean isDownloadingOrInstalling(Progress<Download> progress) {
return progress.getRequest().getOverallDownloadStatus() == Download.PROGRESS
|| progress.getRequest().getOverallDownloadStatus() == Download.PENDING
|| progress.getRequest().getOverallDownloadStatus() == Download.IN_QUEUE;
}
>>>>>>>
@Override protected Configs getConfig() {
return new Configs(1, false);
}
/**
* * <dt><b>Scheduler:</b></dt>
* <dd>{@code getUpdates} operates by default on the {@code io} {@link Scheduler}..</dd>
* </dl>
*/
public Observable<Progress<Download>> getUpdates() {
return installManager.getInstallations();
}
public boolean isDownloadingOrInstalling(Progress<Download> progress) {
return progress.getRequest().getOverallDownloadStatus() == Download.PROGRESS
|| progress.getRequest().getOverallDownloadStatus() == Download.PENDING
|| progress.getRequest().getOverallDownloadStatus() == Download.IN_QUEUE;
} |
<<<<<<<
=======
pushNotificationSocialPeriodicity = 60000;
>>>>>>> |
<<<<<<<
Completable changeSubscribeNewsletter(String isSubscribed);
Single<Account> getAccount(String email);
=======
Single<Account> getAccount();
>>>>>>>
Single<Account> getAccount(String email); |
<<<<<<<
=======
import android.util.Log;
import java.util.List;
>>>>>>>
<<<<<<<
return startDownload(AccessorFactory.getAccessorFor(Download.class), permissionRequest,
download);
=======
return permissionManager.requestExternalStoragePermission(permissionRequest)
.flatMap(success -> permissionManager.requestDownloadAccess(permissionRequest))
.flatMap(success -> Observable.fromCallable(() -> {
aptoideDownloadManager.getDownload(download.getAppId()).first().subscribe(storedDownload -> {
startDownloadService(download.getAppId(), AptoideDownloadManager.DOWNLOADMANAGER_ACTION_START_DOWNLOAD);
}, throwable -> {
if (throwable instanceof DownloadNotFoundException) {
@Cleanup Realm realm = DeprecatedDatabase.get();
DeprecatedDatabase.save(download, realm);
startDownloadService(download.getAppId(), AptoideDownloadManager.DOWNLOADMANAGER_ACTION_START_DOWNLOAD);
}
});
return download;
}).flatMap(aDownload -> aptoideDownloadManager.getDownload(download.getAppId())));
>>>>>>>
return startDownload(AccessorFactory.getAccessorFor(Download.class), permissionRequest,
download); |
<<<<<<<
import cm.aptoide.pt.themes.DarkThemeNewFeatureManager;
=======
import cm.aptoide.pt.themes.ThemeAnalytics;
>>>>>>>
import cm.aptoide.pt.themes.ThemeAnalytics;
import cm.aptoide.pt.themes.DarkThemeNewFeatureManager;
<<<<<<<
@Inject DarkThemeNewFeatureManager darkThemeNewFeatureManager;
=======
@Inject ThemeAnalytics themeAnalytics;
>>>>>>>
@Inject ThemeAnalytics themeAnalytics;
@Inject DarkThemeNewFeatureManager darkThemeNewFeatureManager;
<<<<<<<
darkThemeNewFeatureManager.scheduleNotification();
=======
themeAnalytics.setDarkThemeUserProperty(themeManager.isThemeDark());
>>>>>>>
themeAnalytics.setDarkThemeUserProperty(themeManager.isThemeDark());
darkThemeNewFeatureManager.scheduleNotification(); |
<<<<<<<
private AppViewView view;
private AccountNavigator accountNavigator;
private AppViewAnalytics appViewAnalytics;
private CampaignAnalytics campaignAnalytics;
private AppViewNavigator appViewNavigator;
private AppViewManager appViewManager;
private AptoideAccountManager accountManager;
private Scheduler viewScheduler;
private CrashReport crashReport;
private CompositeSubscription compositeSubscription;
=======
private final AppViewView view;
private final AccountNavigator accountNavigator;
private final AppViewAnalytics appViewAnalytics;
private final CampaignAnalytics campaignAnalytics;
private final AppViewNavigator appViewNavigator;
private final AppViewManager appViewManager;
private final AptoideAccountManager accountManager;
private final Scheduler viewScheduler;
private final CrashReport crashReport;
private final SimilarAppsExperiment similarAppsExperiment;
private final ExternalNavigator externalNavigator;
>>>>>>>
private final AppViewView view;
private final AccountNavigator accountNavigator;
private final AppViewAnalytics appViewAnalytics;
private final CampaignAnalytics campaignAnalytics;
private final AppViewNavigator appViewNavigator;
private final AppViewManager appViewManager;
private final AptoideAccountManager accountManager;
private final Scheduler viewScheduler;
private final CrashReport crashReport;
private final SimilarAppsExperiment similarAppsExperiment;
private final ExternalNavigator externalNavigator;
private CompositeSubscription compositeSubscription;
<<<<<<<
compositeSubscription = new CompositeSubscription();
=======
this.similarAppsExperiment = similarAppsExperiment;
this.externalNavigator = externalNavigator;
>>>>>>>
this.similarAppsExperiment = similarAppsExperiment;
this.externalNavigator = externalNavigator;
compositeSubscription = new CompositeSubscription();
<<<<<<<
chaindestroy();
=======
handleSimilarAppsABTestingImpression();
handleSimilarAppsABTestingConversion();
>>>>>>>
handleSimilarAppsABTestingImpression();
handleSimilarAppsABTestingConversion();
chaindestroy(); |
<<<<<<<
super(Interfaces.class, new UserAgentGenerator() {
@Override public String generateUserAgent() {
return SecurePreferences.getUserAgent();
}
},
WebService.getDefaultConverter(), baseHost
);
=======
super(Interfaces.class, SecurePreferences.getUserAgent(), WebService.getDefaultConverter(),
baseHost);
>>>>>>>
super(Interfaces.class, new UserAgentGenerator() {
@Override public String generateUserAgent() {
return SecurePreferences.getUserAgent();
}
}, WebService.getDefaultConverter(), baseHost);
<<<<<<<
super(Interfaces.class, new UserAgentGenerator() {
@Override public String generateUserAgent() {
return SecurePreferences.getUserAgent();
}
},
converterFactory, baseHost);
=======
super(Interfaces.class, SecurePreferences.getUserAgent(), converterFactory, baseHost);
>>>>>>>
super(Interfaces.class, new UserAgentGenerator() {
@Override public String generateUserAgent() {
return SecurePreferences.getUserAgent();
}
}, converterFactory, baseHost); |
<<<<<<<
notLoggedInShareAnalytics = application.getNotLoggedInShareAnalytics();
aptoideNavigationTracker = application.getAptoideNavigationTracker();
=======
notLoggedInShareAnalytics =
((AptoideApplication) getContext().getApplicationContext()).getNotLoggedInShareAnalytics();
setHasOptionsMenu(true);
>>>>>>>
notLoggedInShareAnalytics = application.getNotLoggedInShareAnalytics();
aptoideNavigationTracker = application.getAptoideNavigationTracker();
setHasOptionsMenu(true); |
<<<<<<<
MoPubAdsManager moPubAdsManager, DownloadStateParser downloadStateParser,
AppViewAnalytics appViewAnalytics, NotificationAnalytics notificationAnalytics,
InstallAnalytics installAnalytics, int limit, Scheduler ioScheduler,
SocialRepository socialRepository, String marketName, AppCoinsManager appCoinsManager,
PromotionsManager promotionsManager, String promotionId,
=======
MoPubAdsManager moPubAdsManager, PreferencesManager preferencesManager,
DownloadStateParser downloadStateParser, AppViewAnalytics appViewAnalytics,
NotificationAnalytics notificationAnalytics, InstallAnalytics installAnalytics, int limit,
Scheduler ioScheduler, String marketName, AppCoinsManager appCoinsManager,
PromotionsManager promotionsManager, String promotionId,
>>>>>>>
MoPubAdsManager moPubAdsManager, DownloadStateParser downloadStateParser,
AppViewAnalytics appViewAnalytics, NotificationAnalytics notificationAnalytics,
InstallAnalytics installAnalytics, int limit, Scheduler ioScheduler, String marketName,
AppCoinsManager appCoinsManager, PromotionsManager promotionsManager, String promotionId,
<<<<<<<
=======
public boolean canShowNotLoggedInDialog() {
return preferencesManager.canShowNotLoggedInDialog() && !isAppcApp();
}
public Completable shareOnTimeline(String packageName, long storeId, String shareType) {
// TODO: 11/04/2019 remove in ASV-1473
return Completable.complete();
}
public Completable dontShowLoggedInInstallRecommendsPreviewDialog() {
return Completable.fromAction(
() -> preferencesManager.setShouldShowInstallRecommendsPreviewDialog(false));
}
public Completable shareOnTimelineAsync(String packageName, long storeId) {
// TODO: 11/04/2019 remove in ASV-1473
return Completable.complete();
}
>>>>>>> |
<<<<<<<
=======
import cm.aptoide.pt.database.accessors.RealmToRealmDatabaseMigration;
import cm.aptoide.pt.database.realm.Download;
>>>>>>>
import cm.aptoide.pt.database.accessors.RealmToRealmDatabaseMigration;
import cm.aptoide.pt.database.realm.Download;
<<<<<<<
=======
private SyncScheduler alarmSyncScheduler;
private NotificationAnalytics notificationAnalytics;
>>>>>>>
private NotificationAnalytics notificationAnalytics;
<<<<<<<
=======
>>>>>>>
<<<<<<<
public IdsRepository getIdsRepository() {
return idsRepository;
}
=======
public NotificationAnalytics getNotificationAnalytics() {
if (notificationAnalytics == null) {
notificationAnalytics =
new NotificationAnalytics(Analytics.getInstance(), AppEventsLogger.newLogger(this),
getBodyInterceptorPoolV7(), getDefaultClient(), WebService.getDefaultConverter(),
tokenInvalidator, cm.aptoide.pt.dataprovider.BuildConfig.APPLICATION_ID,
getDefaultSharedPreferences(), new AptoideInstallParser());
}
return notificationAnalytics;
}
>>>>>>>
public NotificationAnalytics getNotificationAnalytics() {
if (notificationAnalytics == null) {
notificationAnalytics =
new NotificationAnalytics(Analytics.getInstance(), AppEventsLogger.newLogger(this),
getBodyInterceptorPoolV7(), getDefaultClient(), WebService.getDefaultConverter(),
tokenInvalidator, cm.aptoide.pt.dataprovider.BuildConfig.APPLICATION_ID,
getDefaultSharedPreferences(), new AptoideInstallParser());
}
return notificationAnalytics;
}
public IdsRepository getIdsRepository() {
return idsRepository;
} |
<<<<<<<
import cm.aptoide.pt.permission.AccountPermissionProvider;
=======
import cm.aptoide.pt.permission.AccountPermissionProvider;
import cm.aptoide.pt.permission.PermissionProvider;
>>>>>>>
import cm.aptoide.pt.permission.AccountPermissionProvider;
<<<<<<<
import javax.inject.Inject;
import org.parceler.Parcel;
=======
import java.util.Collections;
import java.util.List;
>>>>>>>
import java.util.Collections;
import java.util.List;
import javax.inject.Inject;
<<<<<<<
@Inject ImageValidator imageValidator;
@Inject ImagePickerNavigator imagePickerNavigator;
@Inject UriToPathResolver uriToPathResolver;
@Inject AccountPermissionProvider accountPermissionProvider;
@Inject ImagePickerPresenter imagePickerPresenter;
@Inject ManageStorePresenter manageStorePresenter;
@Inject PhotoFileGenerator photoFileGenerator;
public static ManageStoreFragment newInstance(ViewModel storeModel, boolean goToHome) {
=======
private ManageStoreNavigator manageStoreNavigator;
private ImageValidator imageValidator;
private ImagePickerNavigator imagePickerNavigator;
private UriToPathResolver uriToPathResolver;
private CrashReport crashReport;
private AccountPermissionProvider accountPermissionProvider;
private StoreManager storeManager;
private String packageName;
private PhotoFileGenerator photoFileGenerator;
private View facebookRow;
private CustomTextInputLayout facebookUsernameWrapper;
private View twitchRow;
private View twitterRow;
private View youtubeRow;
private RelativeLayout facebookTextAndPlus;
private RelativeLayout twitchTextAndPlus;
private RelativeLayout twitterTextAndPlus;
private RelativeLayout youtubeTextAndPlus;
private CustomTextInputLayout twitchUsernameWrapper;
private CustomTextInputLayout twitterUsernameWrapper;
private CustomTextInputLayout youtubeUsernameWrapper;
private LinearLayout socialChannels;
private EditText facebookUser;
private EditText twitchUser;
private EditText twitterUser;
private EditText youtubeUser;
private TextView facebookText;
private TextView twitchText;
private TextView twitterText;
private TextView youtubeText;
private ImageView facebookEndRowIcon;
private ImageView twitchEndRowIcon;
private ImageView twitterEndRowIcon;
private ImageView youtubeEndRowIcon;
public static ManageStoreFragment newInstance(ManageStoreViewModel storeModel, boolean goToHome) {
>>>>>>>
private CrashReport crashReport;
private StoreManager storeManager;
private String packageName;
private View facebookRow;
private CustomTextInputLayout facebookUsernameWrapper;
private View twitchRow;
private View twitterRow;
private View youtubeRow;
private RelativeLayout facebookTextAndPlus;
private RelativeLayout twitchTextAndPlus;
private RelativeLayout twitterTextAndPlus;
private RelativeLayout youtubeTextAndPlus;
private CustomTextInputLayout twitchUsernameWrapper;
private CustomTextInputLayout twitterUsernameWrapper;
private CustomTextInputLayout youtubeUsernameWrapper;
private LinearLayout socialChannels;
private EditText facebookUser;
private EditText twitchUser;
private EditText twitterUser;
private EditText youtubeUser;
private TextView facebookText;
private TextView twitchText;
private TextView twitterText;
private TextView youtubeText;
private ImageView facebookEndRowIcon;
private ImageView twitchEndRowIcon;
private ImageView twitterEndRowIcon;
private ImageView youtubeEndRowIcon;
@Inject ImageValidator imageValidator;
@Inject ImagePickerNavigator imagePickerNavigator;
@Inject UriToPathResolver uriToPathResolver;
@Inject AccountPermissionProvider accountPermissionProvider;
@Inject ImagePickerPresenter imagePickerPresenter;
@Inject ManageStorePresenter manageStorePresenter;
@Inject PhotoFileGenerator photoFileGenerator;
public static ManageStoreFragment newInstance(ManageStoreViewModel storeModel, boolean goToHome) {
<<<<<<<
=======
accountPermissionProvider = new AccountPermissionProvider(((PermissionProvider) getActivity()));
storeManager = ((AptoideApplication) getActivity().getApplicationContext()).getStoreManager();
packageName = (getActivity().getApplicationContext()).getPackageName();
String fileProviderAuthority = BuildConfig.APPLICATION_ID + ".provider";
photoFileGenerator = new PhotoFileGenerator(getActivity(),
getActivity().getExternalFilesDir(Environment.DIRECTORY_PICTURES), fileProviderAuthority);
crashReport = CrashReport.getInstance();
uriToPathResolver = new UriToPathResolver(getActivity().getContentResolver());
imagePickerNavigator = new ImagePickerNavigator(getActivityNavigator());
imageValidator = new ImageValidator(ImageLoader.with(getActivity()), Schedulers.computation());
>>>>>>>
<<<<<<<
=======
final ImagePickerPresenter imagePickerPresenter =
new ImagePickerPresenter(this, crashReport, accountPermissionProvider, photoFileGenerator,
imageValidator, AndroidSchedulers.mainThread(), uriToPathResolver, imagePickerNavigator,
getActivity().getContentResolver(), ImageLoader.with(getContext()));
final ManageStorePresenter presenter =
new ManageStorePresenter(this, crashReport, storeManager, uriToPathResolver, packageName,
manageStoreNavigator, goToHome,
new ManageStoreErrorMapper(getResources(), new ErrorsMapper()));
>>>>>>> |
<<<<<<<
String appName, String appIcon, float ratingAverage, Date timestamp, String abUrl,
boolean isLiked, long commentsNumber, long likesNumber, List<UserTimeline> likes,
List<SocialCard.CardComment> comments, CardType cardType, String userContent) {
super(cardId, appIcon, appName, appId, packageName, timestamp, abUrl, cardType, ratingAverage);
=======
String appName, String appIcon, Long storeId, float ratingAverage, Date timestamp,
String abUrl, boolean isLiked, long commentsNumber, long likesNumber,
List<UserTimeline> likes, List<SocialCard.CardComment> comments, CardType cardType) {
super(cardId, appIcon, appName, appId, packageName, timestamp, abUrl, cardType, ratingAverage,
storeId);
>>>>>>>
String appName, String appIcon, Long storeId, float ratingAverage, Date timestamp,
String abUrl, boolean isLiked, long commentsNumber, long likesNumber,
List<UserTimeline> likes, List<SocialCard.CardComment> comments, CardType cardType, String userContent) {
super(cardId, appIcon, appName, appId, packageName, timestamp, abUrl, cardType, ratingAverage,
storeId); |
<<<<<<<
private final AppViewConfiguration appViewConfiguration;
=======
private PreferencesManager preferencesManager;
private DownloadStateParser downloadStateParser;
private AppViewAnalytics appViewAnalytics;
private NotificationAnalytics notificationAnalytics;
>>>>>>>
private final AppViewConfiguration appViewConfiguration;
private PreferencesManager preferencesManager;
private DownloadStateParser downloadStateParser;
private AppViewAnalytics appViewAnalytics;
private NotificationAnalytics notificationAnalytics;
<<<<<<<
StoreUtilsProxy storeUtilsProxy, AptoideAccountManager aptoideAccountManager,
AppViewConfiguration appViewConfiguration) {
=======
StoreUtilsProxy storeUtilsProxy, AptoideAccountManager aptoideAccountManager,
PreferencesManager preferencesManager, DownloadStateParser downloadStateParser,
AppViewAnalytics appViewAnalytics, NotificationAnalytics notificationAnalytics) {
>>>>>>>
StoreUtilsProxy storeUtilsProxy, AptoideAccountManager aptoideAccountManager, AppViewConfiguration appViewConfiguration,
PreferencesManager preferencesManager, DownloadStateParser downloadStateParser,
AppViewAnalytics appViewAnalytics, NotificationAnalytics notificationAnalytics) {
<<<<<<<
this.appViewConfiguration = appViewConfiguration;
=======
this.preferencesManager = preferencesManager;
this.downloadStateParser = downloadStateParser;
this.appViewAnalytics = appViewAnalytics;
this.notificationAnalytics = notificationAnalytics;
>>>>>>>
this.appViewConfiguration = appViewConfiguration;
this.preferencesManager = preferencesManager;
this.downloadStateParser = downloadStateParser;
this.appViewAnalytics = appViewAnalytics;
this.notificationAnalytics = notificationAnalytics; |
<<<<<<<
import cm.aptoide.pt.home.AdMapper;
import cm.aptoide.pt.home.AptoideBottomNavigator;
import cm.aptoide.pt.home.BundlesRepository;
import cm.aptoide.pt.home.Home;
import cm.aptoide.pt.home.HomeNavigator;
import cm.aptoide.pt.home.HomePresenter;
import cm.aptoide.pt.home.HomeView;
=======
import cm.aptoide.pt.home.AptoideBottomNavigator;
import cm.aptoide.pt.home.BottomNavigationMapper;
>>>>>>>
import cm.aptoide.pt.home.AdMapper;
import cm.aptoide.pt.home.AptoideBottomNavigator;
import cm.aptoide.pt.home.BottomNavigationMapper;
import cm.aptoide.pt.home.BundlesRepository;
import cm.aptoide.pt.home.Home;
import cm.aptoide.pt.home.HomeNavigator;
import cm.aptoide.pt.home.HomePresenter;
import cm.aptoide.pt.home.HomeView;
<<<<<<<
@FragmentScope @Provides HomePresenter providesHomePresenter(Home home,
HomeNavigator homeNavigator, AdMapper adMapper) {
return new HomePresenter((HomeView) fragment, home, AndroidSchedulers.mainThread(),
CrashReport.getInstance(), homeNavigator, adMapper);
}
@FragmentScope @Provides HomeNavigator providesHomeNavigator(
FragmentNavigator fragmentNavigator) {
return new HomeNavigator(fragmentNavigator, (AptoideBottomNavigator) fragment.getActivity());
}
@FragmentScope @Provides Home providesHome(BundlesRepository bundlesRepository) {
return new Home(bundlesRepository);
}
=======
@FragmentScope @Provides BottomNavigationMapper provideBottomNavigationMapper() {
return new BottomNavigationMapper();
}
@FragmentScope @Provides MyStoresPresenter provideMyStorePresenter(
BottomNavigationMapper bottomNavigationMapper) {
return new MyStoresPresenter((MyStoresView) fragment,
(AptoideBottomNavigator) fragment.getActivity(), AndroidSchedulers.mainThread(),
bottomNavigationMapper);
}
>>>>>>>
@FragmentScope @Provides HomePresenter providesHomePresenter(Home home,
HomeNavigator homeNavigator, AdMapper adMapper) {
return new HomePresenter((HomeView) fragment, home, AndroidSchedulers.mainThread(),
CrashReport.getInstance(), homeNavigator, adMapper);
}
@FragmentScope @Provides HomeNavigator providesHomeNavigator(
FragmentNavigator fragmentNavigator) {
return new HomeNavigator(fragmentNavigator, (AptoideBottomNavigator) fragment.getActivity());
}
@FragmentScope @Provides Home providesHome(BundlesRepository bundlesRepository) {
return new Home(bundlesRepository);
}
@FragmentScope @Provides BottomNavigationMapper provideBottomNavigationMapper() {
return new BottomNavigationMapper();
}
@FragmentScope @Provides MyStoresPresenter provideMyStorePresenter(
BottomNavigationMapper bottomNavigationMapper) {
return new MyStoresPresenter((MyStoresView) fragment,
(AptoideBottomNavigator) fragment.getActivity(), AndroidSchedulers.mainThread(),
bottomNavigationMapper);
} |
<<<<<<<
=======
private static final String SHOW_SIMILAR_DOWNLOAD = "show_similar_download";
>>>>>>>
private static final String SHOW_SIMILAR_DOWNLOAD = "show_similar_download";
<<<<<<<
=======
private Integer positionY;
private boolean showSimilarDownload;
>>>>>>>
private Integer positionY;
private boolean showSimilarDownload;
<<<<<<<
=======
ViewTreeObserver vto = scrollView.getViewTreeObserver();
if (positionY != null) {
vto.addOnGlobalLayoutListener(() -> {
if (scrollView != null) scrollView.scrollTo(0, positionY);
});
} else if (savedInstanceState != null) {
int[] position = savedInstanceState.getIntArray("ARTICLE_SCROLL_POSITION");
if (position != null) {
vto.addOnGlobalLayoutListener(() -> {
if (scrollView != null) scrollView.scrollTo(position[0], position[1]);
});
}
}
showSimilarDownload =
showSimilarDownload || savedInstanceState != null && savedInstanceState.getBoolean(
SHOW_SIMILAR_DOWNLOAD, false);
>>>>>>>
<<<<<<<
appId = -1;
packageName = null;
=======
scrollView = null;
>>>>>>>
scrollView = null; |
<<<<<<<
import cm.aptoide.pt.database.realm.PaymentAuthorization;
import cm.aptoide.pt.database.realm.PaymentConfirmation;
=======
import cm.aptoide.pt.database.realm.Notification;
>>>>>>>
import cm.aptoide.pt.database.realm.Notification;
import cm.aptoide.pt.database.realm.PaymentAuthorization;
import cm.aptoide.pt.database.realm.PaymentConfirmation;
<<<<<<<
import cm.aptoide.pt.v8engine.account.NoTokenBodyInterceptor;
=======
import cm.aptoide.pt.v8engine.account.LogAccountAnalytics;
>>>>>>>
import cm.aptoide.pt.v8engine.account.LogAccountAnalytics;
import cm.aptoide.pt.v8engine.account.NoTokenBodyInterceptor;
<<<<<<<
=======
import cm.aptoide.pt.v8engine.notification.AptoideNotification;
import cm.aptoide.pt.v8engine.notification.NotificationCenter;
import cm.aptoide.pt.v8engine.notification.NotificationHandler;
import cm.aptoide.pt.v8engine.notification.NotificationIdsMapper;
import cm.aptoide.pt.v8engine.notification.NotificationPolicyFactory;
import cm.aptoide.pt.v8engine.notification.NotificationProvider;
import cm.aptoide.pt.v8engine.notification.NotificationSyncScheduler;
import cm.aptoide.pt.v8engine.notification.NotificationSyncService;
import cm.aptoide.pt.v8engine.notification.SystemNotificationShower;
import cm.aptoide.pt.v8engine.payment.PaymentAnalytics;
>>>>>>>
import cm.aptoide.pt.v8engine.notification.NotificationCenter;
import cm.aptoide.pt.v8engine.notification.NotificationHandler;
import cm.aptoide.pt.v8engine.notification.NotificationIdsMapper;
import cm.aptoide.pt.v8engine.notification.NotificationNetworkService;
import cm.aptoide.pt.v8engine.notification.NotificationPolicyFactory;
import cm.aptoide.pt.v8engine.notification.NotificationProvider;
import cm.aptoide.pt.v8engine.notification.NotificationSyncScheduler;
import cm.aptoide.pt.v8engine.notification.NotificationSyncService;
import cm.aptoide.pt.v8engine.notification.SystemNotificationShower;
<<<<<<<
private OAuthBodyInterceptor oAuthBodyInterceptor;
private ObjectMapper nonNullObjectMapper;
private RequestBodyFactory requestBodyFactory;
private PaymentSyncScheduler paymentSyncScheduler;
private InAppBillingRepository inAppBillingRepository;
private Payer accountPayer;
private InAppBillingSerializer inAppBillingSerialzer;
private AuthorizationFactory authorizationFactory;
private AptoideBilling aptoideBilling;
private PurchaseIntentMapper purchaseIntentMapper;
private PaymentThrowableCodeMapper paymentThrowableCodeMapper;
private MultipartBodyInterceptor multipartBodyInterceptor;
=======
private NotificationHandler notificationHandler;
/**
* Time between pull request for social notifications: {@link AptoideNotification.NotificationType#LIKE}{@link
* AptoideNotification.NotificationType#COMMENT}{@link AptoideNotification.NotificationType#POPULAR}
*/
private long pushNotificationSocialPeriodicity = AlarmManager.INTERVAL_HOUR;
private NotificationCenter notificationCenter;
>>>>>>>
private OAuthBodyInterceptor oAuthBodyInterceptor;
private ObjectMapper nonNullObjectMapper;
private RequestBodyFactory requestBodyFactory;
private PaymentSyncScheduler paymentSyncScheduler;
private InAppBillingRepository inAppBillingRepository;
private Payer accountPayer;
private InAppBillingSerializer inAppBillingSerialzer;
private AuthorizationFactory authorizationFactory;
private AptoideBilling aptoideBilling;
private PurchaseIntentMapper purchaseIntentMapper;
private PaymentThrowableCodeMapper paymentThrowableCodeMapper;
private MultipartBodyInterceptor multipartBodyInterceptor;
private NotificationHandler notificationHandler;
private NotificationCenter notificationCenter;
private QManager qManager;
private EntryPointChooser entryPointChooser;
<<<<<<<
baseBodyInterceptorV3 =
new BaseBodyInterceptorV3(getIdsRepository(), getAptoideMd5sum(), getAptoidePackage(),
getAccountManager());
=======
baseBodyInterceptorV3 = getBaseBodyInterceptorFactory().createV3();
>>>>>>>
baseBodyInterceptorV3 =
new BaseBodyInterceptorV3(getIdsRepository(), getAptoideMd5sum(), getAptoidePackage(),
getAccountManager(), getQManager()); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.