conflict_resolution
stringlengths 27
16k
|
---|
<<<<<<<
import org.apache.fop.util.HexEncoderTestCase;
import org.apache.fop.util.PDFNumberTestCase;
=======
>>>>>>>
import org.apache.fop.util.HexEncoderTestCase;
<<<<<<<
/**
* Builds the test suite
* @return the test suite
*/
public static Test suite() {
TestSuite suite = new TestSuite(
"Test suite for FOP's utility classes");
//$JUnit-BEGIN$
suite.addTest(new TestSuite(PDFNumberTestCase.class));
suite.addTest(new TestSuite(PDFObjectTestCase.class));
suite.addTest(new TestSuite(ColorUtilTestCase.class));
suite.addTest(new TestSuite(BorderPropsTestCase.class));
suite.addTest(new TestSuite(ElementListUtilsTestCase.class));
suite.addTest(new TestSuite(BasicEventTestCase.class));
suite.addTest(new TestSuite(XMLResourceBundleTestCase.class));
suite.addTest(new TestSuite(URIResolutionTestCase.class));
suite.addTest(new TestSuite(HexEncoderTestCase.class));
//$JUnit-END$
return suite;
}
=======
>>>>>>> |
<<<<<<<
import org.apache.xmlgraphics.java2d.color.RenderingIntent;
=======
import org.apache.xmlgraphics.util.UnitConv;
>>>>>>>
import org.apache.xmlgraphics.java2d.color.RenderingIntent;
import org.apache.xmlgraphics.util.UnitConv; |
<<<<<<<
private String fontName;
private String fullName;
private Set<String> familyNames;
private String fontSubName;
private URI embedFileURI;
private String embedResourceName;
private final InternalResourceResolver resourceResolver;
private int capHeight;
private int xHeight;
private int ascender;
private int descender;
=======
private String fontName = null;
private String fullName = null;
private Set<String> familyNames = null;
private String fontSubName = null;
private String embedFileName = null;
private String embedResourceName = null;
private FontResolver resolver = null;
private EmbeddingMode embeddingMode = EmbeddingMode.AUTO;
private int capHeight = 0;
private int xHeight = 0;
private int ascender = 0;
private int descender = 0;
>>>>>>>
private String fontName;
private String fullName;
private Set<String> familyNames;
private String fontSubName;
private URI embedFileURI;
private String embedResourceName;
private final InternalResourceResolver resourceResolver;
private EmbeddingMode embeddingMode = EmbeddingMode.AUTO;
private int capHeight;
private int xHeight;
private int ascender;
private int descender;
<<<<<<<
* Returns an {@link InputStream} representing an embeddable font file.
*
* @return {@link InputStream} for an embeddable font file
=======
* Returns the embedding mode for this font.
* @return embedding mode
*/
public EmbeddingMode getEmbeddingMode() {
return embeddingMode;
}
/**
* Returns a Source representing an embeddable font file.
* @return Source for an embeddable font file
>>>>>>>
* Returns the embedding mode for this font.
* @return embedding mode
*/
public EmbeddingMode getEmbeddingMode() {
return embeddingMode;
}
/**
* Returns an {@link InputStream} representing an embeddable font file.
*
* @return {@link InputStream} for an embeddable font file |
<<<<<<<
import org.apache.fop.pdf.PDFXObject;
import org.apache.fop.render.AbstractImageHandlerGraphics2D;
import org.apache.fop.render.RendererContext;
import org.apache.fop.render.RenderingContext;
import org.apache.fop.svg.PDFGraphics2D;
=======
>>>>>>>
import org.apache.fop.pdf.PDFXObject;
import org.apache.fop.render.AbstractImageHandlerGraphics2D;
import org.apache.fop.render.RendererContext;
import org.apache.fop.render.RenderingContext;
import org.apache.fop.svg.PDFGraphics2D; |
<<<<<<<
private byte[] output;
private int realSize;
private int currentPos;
=======
protected byte[] output = null;
protected int realSize = 0;
protected int currentPos = 0;
>>>>>>>
protected byte[] output;
protected int realSize;
protected int currentPos;
<<<<<<<
private int checkSumAdjustmentOffset;
private int locaOffset;
=======
private int checkSumAdjustmentOffset = 0;
protected int locaOffset = 0;
>>>>>>>
private int checkSumAdjustmentOffset;
protected int locaOffset; |
<<<<<<<
import in.tosc.doandroidlib.objects.Images;
=======
import in.tosc.doandroidlib.objects.Regions;
>>>>>>>
import in.tosc.doandroidlib.objects.Images;
import in.tosc.doandroidlib.objects.Regions; |
<<<<<<<
import in.tosc.doandroidlib.objects.Regions;
=======
import in.tosc.digitaloceanapp.models.Datacenter;
import in.tosc.doandroidlib.objects.Image;
>>>>>>>
import in.tosc.doandroidlib.objects.Regions;
<<<<<<<
=======
private DataCenterViewHolder previousHolder = null;
private static int selectedRegion = -1;
public static final String TAG = "DataCenterAdapter";
>>>>>>>
private DataCenterViewHolder previousHolder = null;
<<<<<<<
if (!(Boolean) holder.countryCV.getTag()) {
DropletCreateActivity.getDroplet().setRegion(regions.getRegions().get(position));
v.setBackgroundColor(Color.argb(60, 0, 90, 230));
holder.countryCV.setBackgroundColor(Color.argb(60, 0, 90, 230));
holder.countryCV.setTag(true);
} else {
v.setBackgroundColor(Color.WHITE);
holder.countryCV.setBackgroundColor(Color.WHITE);
holder.countryCV.setTag(false);
=======
if (!(Boolean) holder.countryCV.getTag()) {
if (previousHolder != null) {
deselectRegion(selectedRegion, previousHolder);
}
DropletCreateActivity.getDroplet().setRegion(countriesList.get(position).getRegion());
selectRegion(position, holder);
previousHolder = holder;
selectedRegion = position;
} else {
deselectRegion(position, holder);
previousHolder = null;
DropletCreateActivity.getDroplet().setRegion(null);
selectedRegion = -1;
>>>>>>>
if (!(Boolean) holder.countryCV.getTag()) {
if (previousHolder != null) {
deselectRegion(selectedRegion, previousHolder);
}
DropletCreateActivity.getDroplet().setRegion(regions.getRegions().get(position));
selectRegion(position, holder);
previousHolder = holder;
selectedRegion = position;
} else {
deselectRegion(position, holder);
previousHolder = null;
DropletCreateActivity.getDroplet().setRegion(null);
selectedRegion = -1; |
<<<<<<<
private CheckFormatTask create(File... files) {
=======
private FormatTask create(File... files) throws Exception {
>>>>>>>
private CheckFormatTask create(File... files) {
<<<<<<<
private CheckFormatTask create(List<File> files) {
Project project = ProjectBuilder.builder().withProjectDir(folder.getRoot()).build();
CheckFormatTask task = project.getTasks().create("underTest", CheckFormatTask.class);
task.lineEndingsPolicy = LineEnding.UNIX.createPolicy();
=======
private FormatTask create(List<File> files) throws Exception {
FormatTask task = createTask(ext -> {});
task.check = true;
>>>>>>>
private CheckFormatTask create(List<File> files) {
Project project = ProjectBuilder.builder().withProjectDir(folder.getRoot()).build();
CheckFormatTask task = project.getTasks().create("underTest", CheckFormatTask.class);
task.lineEndingsPolicy = LineEnding.UNIX.createPolicy();
<<<<<<<
private void assertTaskFailure(CheckFormatTask task, String... expectedLines) {
try {
task.execute();
Assert.fail();
} catch (TaskExecutionException e) {
GradleException cause = (GradleException) e.getCause();
String msg = cause.getMessage();
String firstLine = "The following files had format violations:\n";
String lastLine = "\nRun 'gradlew spotlessApply' to fix these violations.";
Assertions.assertThat(msg).startsWith(firstLine).endsWith(lastLine);
=======
private void assertTaskFailure(FormatTask task, String... expectedLines) {
String msg = getTaskErrorMessage(task);
>>>>>>>
private void assertTaskFailure(CheckFormatTask task, String... expectedLines) {
String msg = getTaskErrorMessage(task);
<<<<<<<
public void lineEndingProblem() throws IOException {
CheckFormatTask task = create(createTestFile("testFile", "A\r\nB\r\nC\r\n"));
=======
public void lineEndingProblem() throws Exception {
FormatTask task = create(createTestFile("testFile", "A\r\nB\r\nC\r\n"));
>>>>>>>
public void lineEndingProblem() throws Exception {
CheckFormatTask task = create(createTestFile("testFile", "A\r\nB\r\nC\r\n"));
<<<<<<<
public void whitespaceProblem() throws IOException {
CheckFormatTask task = create(createTestFile("testFile", "A \nB\t\nC \n"));
=======
public void whitespaceProblem() throws Exception {
FormatTask task = create(createTestFile("testFile", "A \nB\t\nC \n"));
>>>>>>>
public void whitespaceProblem() throws Exception {
CheckFormatTask task = create(createTestFile("testFile", "A \nB\t\nC \n"));
<<<<<<<
public void multipleFiles() throws IOException {
CheckFormatTask task = create(
=======
public void multipleFiles() throws Exception {
FormatTask task = create(
>>>>>>>
public void multipleFiles() throws Exception {
CheckFormatTask task = create( |
<<<<<<<
new SerializableEqualityTester() {
String version = "1.1";
=======
new StepEqualityTester() {
String version = "1.2";
>>>>>>>
new SerializableEqualityTester() {
String version = "1.2";
<<<<<<<
version = "1.0";
=======
version = "1.1";
api.assertThisEqualToThis();
>>>>>>>
version = "1.1"; |
<<<<<<<
@Parameter
private Antlr4 antlr4;
=======
@Parameter(property = "spotlessFiles")
private String filePatterns;
>>>>>>>
@Parameter
private Antlr4 antlr4;
@Parameter(property = "spotlessFiles")
private String filePatterns; |
<<<<<<<
private String[] languages = { "system", "en", "hu", "lt", "es", "ku", "tr" };
@Inject public PreferencesDialog(PingerRegistry pingerRegistry, Config globalConfig, ScannerConfig scannerConfig, GUIConfig guiConfig) {
=======
private String[] languages = { "system", "en", "de", "hu", "lt", "es", "ku", "tr" };
public PreferencesDialog(PingerRegistry pingerRegistry, Config globalConfig, ScannerConfig scannerConfig, GUIConfig guiConfig, ConfigDetectorDialog configDetectorDialog) {
>>>>>>>
private String[] languages = { "system", "en", "de", "hu", "lt", "es", "ku", "tr" };
@Inject public PreferencesDialog(PingerRegistry pingerRegistry, Config globalConfig, ScannerConfig scannerConfig, GUIConfig guiConfig) { |
<<<<<<<
import app.musicplayer.util.Scrollable;
=======
import app.musicplayer.util.SliderSkin;
>>>>>>>
import app.musicplayer.util.Scrollable;
import app.musicplayer.util.SliderSkin;
<<<<<<<
@FXML private ImageView backButton;
@FXML private ImageView skipButton;
@FXML private HBox letterBox;
@FXML private Separator letterSeparator;
/**
* Creates a MainController Object.
* Constructor is called before the initialize() method.
*/
public MainController() {}
=======
@FXML private Pane backButton;
@FXML private Pane playButton;
@FXML private Pane pauseButton;
@FXML private Pane skipButton;
@FXML private Pane loopButton;
@FXML private Pane shuffleButton;
@FXML private Pane volumeButton;
@FXML private HBox controlBox;
>>>>>>>
@FXML private HBox letterBox;
@FXML private Separator letterSeparator;
@FXML private Pane backButton;
@FXML private Pane playButton;
@FXML private Pane pauseButton;
@FXML private Pane skipButton;
@FXML private Pane loopButton;
@FXML private Pane shuffleButton;
@FXML private Pane volumeButton;
@FXML private HBox controlBox;
/**
* Creates a MainController Object.
* Constructor is called before the initialize() method.
*/
public MainController() {}
<<<<<<<
invisibleSlider.valueProperty().addListener(
(slider, oldValue, newValue) -> {
double previous = oldValue.doubleValue();
double current = newValue.doubleValue();
if (!invisibleSlider.isValueChanging() && current != previous + 1) {
int seconds = (int) Math.round(current / 4.0);
invisibleSlider.setValue(seconds * 4);
timeSlider.setValue(seconds * 4);
MusicPlayer.seek(seconds);
}
}
);
for (Node node : letterBox.getChildren()) {
Label label = (Label)node;
label.prefWidthProperty().bind(letterBox.widthProperty().subtract(50).divide(26).subtract(1));
}
=======
>>>>>>>
timeSlider.valueProperty().addListener(
(slider, oldValue, newValue) -> {
double previous = oldValue.doubleValue();
double current = newValue.doubleValue();
if (!timeSlider.isValueChanging() && current != previous + 1) {
int seconds = (int) Math.round(current / 4.0);
timeSlider.setValue(seconds * 4);
MusicPlayer.seek(seconds);
}
}
);
<<<<<<<
@FXML
private void letterClicked(Event e) {
Label eventSource = ((Label)e.getSource());
char letter = eventSource.getText().charAt(0);
subViewController.scroll(letter);
}
public ScrollPane getScrollPane() {
return subViewRoot;
}
=======
@FXML
private void loopToggle() {
}
@FXML
private void shuffleToggle() {
}
@FXML
private void volumeClick() {
}
public ScrollPane getScrollPane() {
return this.subViewRoot;
}
>>>>>>>
@FXML
private void letterClicked(Event e) {
Label eventSource = ((Label)e.getSource());
char letter = eventSource.getText().charAt(0);
subViewController.scroll(letter);
}
@FXML
private void loopToggle() {
}
@FXML
private void shuffleToggle() {
}
@FXML
private void volumeClick() {
}
public ScrollPane getScrollPane() {
return this.subViewRoot;
} |
<<<<<<<
void addAppWidgetFromPick(Intent data) {
=======
private void manageApps() {
startActivity(new Intent(android.provider.Settings.ACTION_MANAGE_ALL_APPLICATIONS_SETTINGS));
}
void addAppWidget(Intent data) {
>>>>>>>
private void manageApps() {
startActivity(new Intent(android.provider.Settings.ACTION_MANAGE_ALL_APPLICATIONS_SETTINGS));
}
void addAppWidgetFromPick(Intent data) { |
<<<<<<<
mWorkspace.getCurrentPage(), cellInfo.cellX, cellInfo.cellY, false);
mFolders.put(folderInfo.id, folderInfo);
=======
mWorkspace.getCurrentScreen(), cellInfo.cellX, cellInfo.cellY, false);
sFolders.put(folderInfo.id, folderInfo);
>>>>>>>
mWorkspace.getCurrentPage(), cellInfo.cellX, cellInfo.cellY, false);
sFolders.put(folderInfo.id, folderInfo); |
<<<<<<<
=======
if (mScroller.isFinished() && mChildCountOnLastMeasure != getChildCount() &&
!mDeferringForDelete) {
setCurrentPage(getNextPage());
}
mChildCountOnLastMeasure = getChildCount();
updateScrollingIndicatorPosition();
>>>>>>>
if (mScroller.isFinished() && mChildCountOnLastMeasure != getChildCount() &&
!mDeferringForDelete) {
setCurrentPage(getNextPage());
}
mChildCountOnLastMeasure = getChildCount(); |
<<<<<<<
BusProvider.getInstance().post(new OpeningStoreEvent());
mLock.unlock();
// Start the setup and call the listener when the setup is over
StoreUtils.LogDebug(TAG, "Starting setup.");
mHelper.startSetup(new IabHelper.OnIabSetupFinishedListener() {
public void onIabSetupFinished(IabResult result) {
StoreUtils.LogDebug(TAG, "Setup finished.");
if (result.isFailure()) {
StoreUtils.LogDebug(TAG, "There's no connectivity with the billing service.");
BusProvider.getInstance().post(new BillingNotSupportedEvent());
stopIabHelper();
return;
}
=======
>>>>>>>
<<<<<<<
try {
Intent intent = new Intent(SoomlaApp.getAppContext(), IabActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.putExtra(PROD_ID, googleMarketItem.getProductId());
intent.putExtra(EXTRA_DATA, payload);
SoomlaApp.getAppContext().startActivity(intent);
} catch(Exception e){
StoreUtils.LogError(TAG, "Error purchasing item " + e.getMessage());
BusProvider.getInstance().post(new UnexpectedStoreErrorEvent(e.getMessage()));
}
=======
switch (purchase.getPurchaseState()) {
case 0:
StoreUtils.LogDebug(TAG, "Purchase successful.");
BusProvider.getInstance().post(new PlayPurchaseEvent(pvi, developerPayload));
pvi.give(1);
BusProvider.getInstance().post(new ItemPurchasedEvent(pvi));
consumeIfConsumable(purchase);
break;
case 1:
case 2:
StoreUtils.LogDebug(TAG, "Purchase refunded.");
if (!StoreConfig.friendlyRefunds) {
pvi.take(1);
}
BusProvider.getInstance().post(new PlayRefundEvent(pvi, developerPayload));
break;
}
>>>>>>>
switch (purchase.getPurchaseState()) {
case 0:
StoreUtils.LogDebug(TAG, "Purchase successful.");
BusProvider.getInstance().post(new PlayPurchaseEvent(pvi, developerPayload));
pvi.give(1);
BusProvider.getInstance().post(new ItemPurchasedEvent(pvi));
consumeIfConsumable(purchase);
break;
case 1:
case 2:
StoreUtils.LogDebug(TAG, "Purchase refunded.");
if (!StoreConfig.friendlyRefunds) {
pvi.take(1);
}
BusProvider.getInstance().post(new PlayRefundEvent(pvi, developerPayload));
break;
}
<<<<<<<
private boolean created = false;
=======
>>>>>>>
<<<<<<<
if(created)
{
finish();
return;
}
created = true;
=======
>>>>>>>
<<<<<<<
StoreController sc = StoreController.getInstance();
sc.mHelper.launchPurchaseFlow( this, productId, Consts.RC_REQUEST, sc.mPurchaseFinishedListener, payload);
} catch (Exception e) {
=======
if (!StoreController.getInstance().buyWithGooglePlayInner(this, productId, payload)) {
finish();
}
}catch (Exception e) {
>>>>>>>
if (!StoreController.getInstance().buyWithGooglePlayInner(this, productId, payload)) {
finish();
}
}catch (Exception e) {
<<<<<<<
if (!StoreController.getInstance().mHelper.handleActivityResult(requestCode, resultCode, data))
super.onActivityResult(requestCode, resultCode, data);
=======
if (StoreController.getInstance().mHelper == null)
{
StoreUtils.LogError(TAG, "helper is null in onActivityResult.");
BusProvider.getInstance().post(new UnexpectedStoreErrorEvent());
}
}
>>>>>>>
if (StoreController.getInstance().mHelper == null)
{
StoreUtils.LogError(TAG, "helper is null in onActivityResult.");
BusProvider.getInstance().post(new UnexpectedStoreErrorEvent());
}
} |
<<<<<<<
=======
import android.text.TextUtils;
import com.soomla.billing.BillingService;
>>>>>>>
<<<<<<<
public void initialize(IStoreAssets storeAssets, String publicKey, String customSecret) {
=======
public boolean initialize(IStoreAssets storeAssets,
String publicKey,
String customSecret){
>>>>>>>
public void initialize(IStoreAssets storeAssets, String publicKey, String customSecret) {
<<<<<<<
if (publicKey != null && publicKey.length() != 0) {
=======
if (publicKey != null && !TextUtils.isEmpty(publicKey)) {
>>>>>>>
if (publicKey != null && publicKey.length() != 0) {
<<<<<<<
} else if (prefs.getString(StoreConfig.CUSTOM_SEC, "").length() == 0) {
StoreUtils.LogError(TAG, "customSecret is null or empty. Can't initialize store !!");
return;
=======
} else if (TextUtils.isEmpty(prefs.getString(StoreConfig.CUSTOM_SEC, ""))) {
StoreUtils.LogError(TAG, "customSecret is null or empty. can't initialize store !!");
return false;
>>>>>>>
} else if (prefs.getString(StoreConfig.CUSTOM_SEC, "").length() == 0) {
StoreUtils.LogError(TAG, "customSecret is null or empty. Can't initialize store !!");
return;
<<<<<<<
if (publicKey.length() == 0 || publicKey.equals("[YOUR PUBLIC KEY FROM GOOGLE PLAY]")) {
=======
if (TextUtils.isEmpty(publicKey) || publicKey.equals("[YOUR PUBLIC KEY FROM GOOGLE PLAY]")) {
>>>>>>>
if (publicKey.length() == 0 || publicKey.equals("[YOUR PUBLIC KEY FROM GOOGLE PLAY]")) {
<<<<<<<
=======
initCompatibilityLayer(activity);
/* Initialize StoreInfo from database in case any changes were done to it while the store was closed */
// StoreInfo.initializeFromDB();
/* Billing */
startBillingService();
BusProvider.getInstance().post(new OpeningStoreEvent());
mStoreOpen = true;
mLock.unlock();
>>>>>>> |
<<<<<<<
public static void remap(Sentence source, Translation translation) {
MappingTag[] sourceMappingTags = new MappingTag[source.getTags().length];
=======
public void remap(Sentence source, Translation translation) {
>>>>>>>
public static void remap(Sentence source, Translation translation) {
<<<<<<<
protected static void setAlignmentMap(ArrayList<ArrayList<Integer>> alignmentMap, int sourceLength, int[][] alignments) {
=======
protected void setAlignmentMap(ArrayList<ArrayList<Integer>> alignmentMap, int sourceLength, int targetLength, int[][] alignments) {
>>>>>>>
protected static void setAlignmentMap(ArrayList<ArrayList<Integer>> alignmentMap, int sourceLength, int targetLength, int[][] alignments) {
<<<<<<<
TagManager.remap(source, translation);
System.out.println(translation);
System.out.println(translation.getStrippedString());
=======
new TagManager().remap(source, translation);
System.out.println("TRANSLATION: " + translation);
System.out.println("TRANSLATION (stripped): " + translation.getStrippedString());
>>>>>>>
TagManager.remap(source, translation);
System.out.println("TRANSLATION: " + translation);
System.out.println("TRANSLATION (stripped): " + translation.getStrippedString()); |
<<<<<<<
import eu.modernmt.persistence.Database;
import eu.modernmt.persistence.cassandra.CassandraDatabase;
import eu.modernmt.util.Timer;
import org.apache.commons.io.IOUtils;
=======
>>>>>>>
import eu.modernmt.persistence.Database;
import eu.modernmt.persistence.cassandra.CassandraDatabase;
import org.apache.commons.io.IOUtils; |
<<<<<<<
=======
/**
* Returns an ordered renderable for this placemark. The renderable may be a new instance or an existing instance.
*
* @return The DrawablePlacemark to use for rendering.
*/
protected DrawablePlacemark makeDrawablePlacemark(DrawContext dc) {
// Create a new instance if necessary, otherwise reuse the existing instance
// TODO: consider pooling of DrawablePlacemarks
if (this.drawablePlacemark == null) {
this.drawablePlacemark = new DrawablePlacemark();
}
return this.drawablePlacemark;
}
/**
* Prepares this placemark's icon or symbol to for drawing in a subsequent drawing pass.
* <p>
* Implementations must be careful not to leak resources from Placemark into the Drawable.
*
* @param dc The current DrawContext.
* @param drawable The Drawable to be prepared.
*/
>>>>>>>
/**
* Prepares this placemark's icon or symbol to for drawing in a subsequent drawing pass.
* <p>
* Implementations must be careful not to leak resources from Placemark into the Drawable.
*
* @param dc The current DrawContext.
* @param drawable The Drawable to be prepared.
*/ |
<<<<<<<
=======
protected String aboutBoxTitle = "Title goes here";
protected String aboutBoxText = "Description goes here;";
>>>>>>>
protected String aboutBoxTitle = "Title goes here";
protected String aboutBoxText = "Description goes here;"; |
<<<<<<<
=======
import gov.nasa.worldwind.util.LevelSet;
import gov.nasa.worldwind.util.LevelSetConfig;
>>>>>>>
import gov.nasa.worldwind.util.LevelSet;
import gov.nasa.worldwind.util.LevelSetConfig;
<<<<<<<
int matrixWidth = sector.isFullSphere() ? 2 : 1;
int matrixHeight = 1;
int tileWidth = 256;
int tileHeight = 256;
=======
LevelSetConfig levelSetConfig = new LevelSetConfig();
levelSetConfig.sector.set(sector);
levelSetConfig.numLevels = numLevels;
this.setLevelSet(new LevelSet(levelSetConfig));
>>>>>>>
if (sector == null) {
throw new IllegalArgumentException(
Logger.makeMessage("Wcs100ElevationCoverage", "constructor", "The sector is null"));
}
if (numLevels < 0) {
throw new IllegalArgumentException(
Logger.makeMessage("Wcs100ElevationCoverage", "constructor", "The number of levels must be greater than 0"));
}
int matrixWidth = sector.isFullSphere() ? 2 : 1;
int matrixHeight = 1;
int tileWidth = 256;
int tileHeight = 256; |
<<<<<<<
=======
import net.sf.jasperreports.engine.fonts.FontInfo;
import net.sf.jasperreports.engine.fonts.FontSetInfo;
>>>>>>>
<<<<<<<
=======
boolean isBold = TextAttribute.WEIGHT_BOLD.equals(attributes.get(TextAttribute.WEIGHT));
boolean isItalic = TextAttribute.POSTURE_OBLIQUE.equals(attributes.get(TextAttribute.POSTURE));
String fontFamilyAttr = (String)attributes.get(TextAttribute.FAMILY);
FontInfo fontInfo = (FontInfo) attributes.get(JRTextAttribute.FONT_INFO);
String defaultFontFamily;
if (fontInfo == null)
{
//no resolved font, using the family
defaultFontFamily = fontFamilyAttr;
//check if the family is an extension font family
fontInfo = fontUtil.getFontInfo(fontFamilyAttr, locale);
}
else
{
//we have an already resolved font, using it
defaultFontFamily = fontInfo.getFontFamily().getName();
}
String exportFont = null;
if (fontInfo == null)
{
//we don't have a resolved font family, check if it's a font set
FontSetInfo fontSetInfo = fontUtil.getFontSetInfo(fontFamilyAttr, locale);
if (fontSetInfo != null)
{
//it's a font set, check the font mapping
exportFont = fontSetInfo.getFontSet().getExportFont(getExporterKey());
}
}
else
{
//it's a font family, check the font mapping
exportFont = fontInfo.getFontFamily().getExportFont(getExporterKey());
}
//by default the font family is used
String fontFamily = defaultFontFamily;
if (exportFont != null)
{
//we have a font mapping
fontFamily = exportFont;
}
else if (fontInfo != null)
{
HtmlExporterOutput output = getExporterOutput();
@SuppressWarnings("deprecation")
HtmlResourceHandler fontHandler =
output.getFontHandler() == null
? getFontHandler()
: output.getFontHandler();
@SuppressWarnings("deprecation")
HtmlResourceHandler resourceHandler =
getExporterOutput().getResourceHandler() == null
? getResourceHandler()
: getExporterOutput().getResourceHandler();
if (fontHandler != null && resourceHandler != null)
{
HtmlFont htmlFont = HtmlFont.getInstance(locale, fontInfo, isBold, isItalic);
if (htmlFont != null)
{
if (!fontsToProcess.containsKey(htmlFont.getId()))
{
fontsToProcess.put(htmlFont.getId(), htmlFont);
HtmlFontUtil.getInstance(jasperReportsContext).handleHtmlFont(resourceHandler, htmlFont);
}
fontFamily = htmlFont.getShortId();
}
}
}
>>>>>>> |
<<<<<<<
fieldOptionMap.put("--optimize-interval",
new Option<String>("Alpha & Beta optimization frequency ",
=======
this.fieldOptionMap.put("--optimize-interval",
new Option<String>("Interval between hyperprior optimizations ",
>>>>>>>
this.fieldOptionMap.put("--optimize-interval",
new Option<String>("Alpha & Beta optimization frequency ",
<<<<<<<
fieldOptionMap.put("--alpha",
new Option<String>("Topic density parameter (Alpha) ",
"50", "train", true));
fieldOptionMap.put("--beta",
new Option<String>("Word density parameter (Beta) ",
"0.01", "train", true));
fieldOptionMap.put("--num-threads", new Option<String>("Number of training threads ",
=======
this.fieldOptionMap.put("--num-threads", new Option<String>("Number of training threads ",
>>>>>>>
this.fieldOptionMap.put("--alpha",
new Option<String>("Topic density parameter (Alpha) ",
"50", "train", true));
this.fieldOptionMap.put("--beta",
new Option<String>("Word density parameter (Beta) ",
"0.01", "train", true));
this.fieldOptionMap.put("--num-threads", new Option<String>("Number of training threads ", |
<<<<<<<
import java.util.concurrent.TimeoutException;
=======
import java.util.List;
import java.util.Map;
>>>>>>>
import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeoutException;
<<<<<<<
public MCResult verifyAndPrint(BinaryInvariant inv) throws IOException,
InterruptedException, TimeoutException {
String cStr = cfsm.toPromelaString(inv, 5);
spin.verify(cStr, 60);
=======
public Map<Integer, MCResult> verifyAndPrint(List<BinaryInvariant> invs)
throws IOException, InterruptedException {
String cStr = cfsm.toPromelaString(invs, 5);
>>>>>>>
public Map<Integer, MCResult> verifyAndPrint(List<BinaryInvariant> invs)
throws IOException, InterruptedException, TimeoutException {
String cStr = cfsm.toPromelaString(invs, 5);
spin.verify(cStr, 60); |
<<<<<<<
@Option(value = "Check multiple Spin invariants when model checking.")
public boolean spinMultipleInvs = true;
=======
@Option(
value = "Run model checking processes in parallel. (Currently only for McScM)",
aliases = { "-p" })
public boolean runParallel = false;
/**
* The default parallelization factor is set as number of cores available,
* which provides the most optimal performance.
*/
@Option(value = "Number of model checking processes to run in parallel.",
aliases = { "-pFactor" })
public int numParallel = Runtime.getRuntime().availableProcessors();
>>>>>>>
@Option(
value = "Check multiple Spin invariants when model checking.")
public boolean spinMultipleInvs = true;
@Option(
value = "Run model checking processes in parallel. (Currently only for McScM)",
aliases = { "-p" })
public boolean runParallel = false;
/**
* The default parallelization factor is set as number of cores available,
* which provides the most optimal performance.
*/
@Option(value = "Number of model checking processes to run in parallel.",
aliases = { "-pFactor" })
public int numParallel = Runtime.getRuntime().availableProcessors(); |
<<<<<<<
ConditionalFormattingData detailCfd = getConditionalFormattingData(element, jrContext, reportContext, dataset, detailTextField, null);
=======
ConditionalFormattingData detailCfd = getConditionalFormattingData(jrContext, dataset, tableUUID, detailTextField, null,
locale, timeZone);
>>>>>>>
ConditionalFormattingData detailCfd = getConditionalFormattingData(element, jrContext, dataset, detailTextField, null,
locale, timeZone);
<<<<<<<
textField,
groupInfo.getName()
=======
tableUuid,
textField,
groupInfo.getName(),
locale,
timeZone
>>>>>>>
textField,
groupInfo.getName(),
locale,
timeZone |
<<<<<<<
// 拼接的路径:/tmpeladmin-gen-temp/,这个路径在Linux下需要root用户才有权限创建,非root用户会权限错误而失败,更改为: /tmp/eladmin-gen-temp/
// String tempPath =SYS_TEM_DIR + "eladmin-gen-temp" + File.separator + genConfig.getTableName() + File.separator;
String tempPath = SYS_TEM_DIR + "eladmin-gen-temp" + File.separator + genConfig.getTableName() + File.separator;
=======
String tempPath = System.getProperty("java.io.tmpdir") + "sk-admin-gen-temp" + File.separator + genConfig.getTableName() + File.separator;
>>>>>>>
// 拼接的路径:/tmpeladmin-gen-temp/,这个路径在Linux下需要root用户才有权限创建,非root用户会权限错误而失败,更改为: /tmp/eladmin-gen-temp/
// String tempPath =SYS_TEM_DIR + "eladmin-gen-temp" + File.separator + genConfig.getTableName() + File.separator;
String tempPath = System.getProperty("java.io.tmpdir") + "sk-admin-gen-temp" + File.separator + genConfig.getTableName() + File.separator; |
<<<<<<<
=======
import net.consensys.cava.bytes.Bytes;
import net.consensys.cava.bytes.Bytes32;
import net.consensys.cava.crypto.Hash;
import net.consensys.cava.ssz.SSZ;
>>>>>>>
<<<<<<<
import tech.pegasys.artemis.util.bls.BLSSignature;
=======
import tech.pegasys.artemis.util.hashtree.HashTreeUtil;
import tech.pegasys.artemis.util.hashtree.HashTreeUtil.SSZTypes;
>>>>>>>
import tech.pegasys.artemis.util.bls.BLSSignature;
import tech.pegasys.artemis.util.hashtree.HashTreeUtil;
import tech.pegasys.artemis.util.hashtree.HashTreeUtil.SSZTypes;
<<<<<<<
public static void verify_signature(BeaconState state, BeaconBlock block)
throws BlockProcessingException {
try {
// Let proposal = Proposal(block.slot, BEACON_CHAIN_SHARD_NUMBER,
// signed_root(block, "signature"), block.signature).
Proposal proposal =
new Proposal(
block.getSlot(),
Constants.BEACON_CHAIN_SHARD_NUMBER,
block.signedRoot("signature"),
block.getSignature());
// Verify that bls_verify(pubkey=state.validator_registry[get_beacon_proposer_index(state,
// state.slot)].pubkey, message_hash=signed_root(proposal, "signature"),
// signature=block.signature,
// domain=get_domain(state.fork, state.slot, DOMAIN_PROPOSAL)) is valid.
int proposerIndex = BeaconStateUtil.get_beacon_proposer_index(state, state.getSlot());
BLSPublicKey pubkey = state.getValidator_registry().get(proposerIndex).getPubkey();
long domain = get_domain(state.getFork(), get_current_epoch(state), DOMAIN_PROPOSAL);
Bytes32 messageHash = proposal.signedRoot("signature");
=======
public static void process_randao(BeaconState state, BeaconBlock block) {
Validator proposer =
state.getValidator_registry().get(get_beacon_proposer_index(state, state.getSlot()));
>>>>>>>
public static void process_randao(BeaconState state, BeaconBlock block) {
Validator proposer =
state.getValidator_registry().get(get_beacon_proposer_index(state, state.getSlot()));
<<<<<<<
// - Run penalize_validator(state, proposer_slashing.proposer_index)
penalize_validator(state, (int) proposer_slashing.getProposer_index());
=======
slash_validator(state, proposer_slashing.getProposer_index().intValue());
>>>>>>>
slash_validator(state, proposer_slashing.getProposer_index().intValue());
<<<<<<<
attestation.getData().getJustified_epoch() == state.getPrevious_justified_epoch(),
"in process attestations(): 4 attestation justified epoch:"
+ attestation.getData().getJustified_epoch()
+ " state prev justified epoch:"
+ state.getPrevious_justified_epoch());
=======
attestation.getData().getSource_epoch().equals(state.getPrevious_justified_epoch()),
"Previous epoch attestation epoch number error");
checkArgument(
attestation.getData().getSource_root().equals(state.getPrevious_justified_root()),
"Previous epoch attestation root error");
>>>>>>>
attestation.getData().getSource_epoch().equals(state.getPrevious_justified_epoch()),
"Previous epoch attestation epoch number error");
checkArgument(
attestation.getData().getSource_root().equals(state.getPrevious_justified_root()),
"Previous epoch attestation root error");
<<<<<<<
.getLatest_crosslinks()
.get(toIntExact(attestation.getData().getShard()))
.equals(attestation.getData().getLatest_crosslink())
|| state
.getLatest_crosslinks()
.get(toIntExact(attestation.getData().getShard()))
.equals(
new Crosslink(
slot_to_epoch(attestationDataSlot),
attestation.getData().getCrosslink_data_root())),
"in process attestations(): 6");
=======
.getLatest_crosslinks()
.get(toIntExact(attestation.getData().getShard().longValue()));
checkArgument(
latest_crosslink.equals(attestation.getData().getPrevious_crosslink())
|| latest_crosslink.equals(
new Crosslink(
slot_to_epoch(attestationDataSlot),
attestation.getData().getCrosslink_data_root())),
"Crosslink data is invalid");
>>>>>>>
.getLatest_crosslinks()
.get(toIntExact(attestation.getData().getShard().longValue()));
checkArgument(
latest_crosslink.equals(attestation.getData().getPrevious_crosslink())
|| latest_crosslink.equals(
new Crosslink(
slot_to_epoch(attestationDataSlot),
attestation.getData().getCrosslink_data_root())),
"Crosslink data is invalid");
<<<<<<<
static boolean verify_randao(
BeaconState state, BeaconBlock block, long currentEpoch, Bytes32 currentEpochBytes)
throws IllegalStateException {
// Let proposer = state.validator_registry[get_beacon_proposer_index(state, state.slot)].
int proposerIndex = BeaconStateUtil.get_beacon_proposer_index(state, state.getSlot());
Validator proposer = state.getValidator_registry().get(proposerIndex);
// Verify that bls_verify(pubkey=proposer.pubkey,
// message=int_to_bytes32(get_current_epoch(state)), signature=block.randao_reveal,
// domain=get_domain(state.fork, get_current_epoch(state), DOMAIN_RANDAO)).
long domain = get_domain(state.getFork(), currentEpoch, DOMAIN_RANDAO);
return bls_verify(proposer.getPubkey(), currentEpochBytes, block.getRandao_reveal(), domain);
}
=======
>>>>>>>
<<<<<<<
bls_verify_multiple(pubkeys, messages, signature, domain),
"checkArgument threw and exception in verify_bitfields_and_aggregate_signature() 4");
// TODO
=======
bls_verify_multiple(
Arrays.asList(bls_aggregate_pubkeys(pubkey0), bls_aggregate_pubkeys(pubkey1)),
Arrays.asList(
new AttestationDataAndCustodyBit(attestation.getData(), false).hash_tree_root(),
new AttestationDataAndCustodyBit(attestation.getData(), true).hash_tree_root()),
attestation.getAggregate_signature(),
get_domain(
state.getFork(),
slot_to_epoch(attestation.getData().getSlot()),
DOMAIN_ATTESTATION)),
"checkArgument threw and exception in verify_bitfields_and_aggregate_signature()");
>>>>>>>
bls_verify_multiple(
Arrays.asList(bls_aggregate_pubkeys(pubkey0), bls_aggregate_pubkeys(pubkey1)),
Arrays.asList(
new AttestationDataAndCustodyBit(attestation.getData(), false).hash_tree_root(),
new AttestationDataAndCustodyBit(attestation.getData(), true).hash_tree_root()),
attestation.getAggregate_signature(),
get_domain(
state.getFork(),
slot_to_epoch(attestation.getData().getSlot()),
DOMAIN_ATTESTATION)),
"checkArgument threw and exception in verify_bitfields_and_aggregate_signature()");
<<<<<<<
// - Let serialized_deposit_data be the serialized form of deposit.deposit_data.
// It should be 8 bytes for deposit_data.amount followed by 8 bytes for
// deposit_data.timestamp and then the DepositInput bytes. That is,
// it should match deposit_data in the Ethereum 1.0 deposit contract of which
// the hash was placed into the Merkle tree.
Bytes serialized_deposit_data = deposit.getDeposit_data().toBytes();
checkArgument(Objects.equals(state.getDeposit_index(), deposit.getIndex()));
// - Vadliate verify_merkle_branch(hash(serialized_deposit_data), deposit.branch,
// DEPOSIT_CONTRACT_TREE_DEPTH, deposit.index, state.latest_eth1_data.deposit_root)
checkArgument(
verify_merkle_branch(
Hash.keccak256(serialized_deposit_data),
deposit.getBranch(),
DEPOSIT_CONTRACT_TREE_DEPTH,
toIntExact(deposit.getIndex()),
state.getLatest_eth1_data().getDeposit_root()));
// - Run process_deposit
process_deposit(state, deposit);
state.setDeposit_index(state.getDeposit_index() + 1);
=======
BeaconStateUtil.process_deposit(state, deposit);
>>>>>>>
BeaconStateUtil.process_deposit(state, deposit);
<<<<<<<
validator.getExit_epoch() > get_entry_exit_effect_epoch(get_current_epoch(state)),
"checkArgument threw and exception in processExits()");
=======
validator.getExit_epoch().compareTo(FAR_FUTURE_EPOCH) == 0, "Validator has exited");
// Verify the validator has not initiated an exit
checkArgument(!validator.hasInitiatedExit(), "Validator has initiated exit already");
>>>>>>>
validator.getExit_epoch().compareTo(FAR_FUTURE_EPOCH) == 0, "Validator has exited");
// Verify the validator has not initiated an exit
checkArgument(!validator.hasInitiatedExit(), "Validator has initiated exit already");
<<<<<<<
get_current_epoch(state) >= voluntaryExit.getEpoch(),
"checkArgument threw and exception in processExits()");
=======
get_current_epoch(state).compareTo(voluntaryExit.getEpoch()) >= 0,
"Exit is not valid yet");
>>>>>>>
get_current_epoch(state).compareTo(voluntaryExit.getEpoch()) >= 0,
"Exit is not valid yet");
<<<<<<<
.get(toIntExact(transfer.getFrom()))
=======
.get(transfer.getSender().intValue())
>>>>>>>
.get(transfer.getSender().intValue())
<<<<<<<
get_domain(
state.getFork(), slot_to_epoch(transfer.getSlot()), Constants.DOMAIN_TRANSFER)));
// - Set state.validator_balances[transfer.from] -= transfer.amount + transfer.fee
long fromBalance = state.getValidator_balances().get(toIntExact(transfer.getFrom()));
fromBalance = fromBalance - transfer.getAmount() - transfer.getFee();
state.getValidator_balances().set(toIntExact(transfer.getFrom()), fromBalance);
// - Set state.validator_balances[transfer.to] += transfer.amount
long toBalance = state.getValidator_balances().get(toIntExact(transfer.getFrom()));
toBalance = toBalance + transfer.getAmount();
state.getValidator_balances().set(toIntExact(transfer.getTo()), toBalance);
// - Set state.validator_balances[get_beacon_proposer_index(state, state.slot)]
// += transfer.fee
long proposerBalance =
=======
get_domain(state.getFork(), slot_to_epoch(transfer.getSlot()), DOMAIN_TRANSFER)),
"Transfer signature invalid");
// Process the transfer
UnsignedLong senderBalance =
state.getValidator_balances().get(transfer.getSender().intValue());
senderBalance = senderBalance.minus(transfer.getAmount()).minus(transfer.getFee());
state
.getValidator_balances()
.set(toIntExact(transfer.getSender().longValue()), senderBalance);
UnsignedLong recipientBalance =
state.getValidator_balances().get(transfer.getSender().intValue());
recipientBalance = recipientBalance.plus(transfer.getAmount());
state
.getValidator_balances()
.set(toIntExact(transfer.getRecipient().longValue()), recipientBalance);
UnsignedLong proposerBalance =
>>>>>>>
get_domain(state.getFork(), slot_to_epoch(transfer.getSlot()), DOMAIN_TRANSFER)),
"Transfer signature invalid");
// Process the transfer
UnsignedLong senderBalance =
state.getValidator_balances().get(transfer.getSender().intValue());
senderBalance = senderBalance.minus(transfer.getAmount()).minus(transfer.getFee());
state
.getValidator_balances()
.set(toIntExact(transfer.getSender().longValue()), senderBalance);
UnsignedLong recipientBalance =
state.getValidator_balances().get(transfer.getSender().intValue());
recipientBalance = recipientBalance.plus(transfer.getAmount());
state
.getValidator_balances()
.set(toIntExact(transfer.getRecipient().longValue()), recipientBalance);
UnsignedLong proposerBalance = |
<<<<<<<
import org.apache.tuweni.bytes.Bytes;
import org.apache.tuweni.bytes.Bytes32;
import org.apache.tuweni.crypto.Hash;
=======
import net.consensys.cava.bytes.Bytes;
import net.consensys.cava.bytes.Bytes32;
import net.consensys.cava.crypto.Hash;
import net.consensys.cava.ssz.SSZ;
>>>>>>>
import org.apache.tuweni.bytes.Bytes;
import org.apache.tuweni.bytes.Bytes32;
import org.apache.tuweni.crypto.Hash;
import org.apache.tuweni.ssz.SSZ;
<<<<<<<
public static BeaconStateWithCache get_genesis_beacon_state(
=======
/**
* Get the genesis BeaconState.
*
* @param state
* @param genesis_validator_deposits
* @param genesis_time
* @param genesis_eth1_data
* @return
* @throws IllegalStateException
*/
public static BeaconStateWithCache get_genesis_beacon_state(
>>>>>>>
/**
* Get the genesis BeaconState.
*
* @param state
* @param genesis_validator_deposits
* @param genesis_time
* @param genesis_eth1_data
* @return
* @throws IllegalStateException
*/
public static BeaconStateWithCache get_genesis_beacon_state(
<<<<<<<
ArrayList<Deposit> genesis_validator_deposits,
long genesis_time,
Eth1Data latest_eth1_data)
=======
ArrayList<Deposit> genesis_validator_deposits,
UnsignedLong genesis_time,
Eth1Data genesis_eth1_data)
>>>>>>>
ArrayList<Deposit> genesis_validator_deposits,
UnsignedLong genesis_time,
Eth1Data genesis_eth1_data)
<<<<<<<
long current_committees_per_epoch = get_current_epoch_committee_count(state);
committees_per_epoch = get_next_epoch_committee_count(state);
shuffling_epoch = next_epoch;
long epochs_since_last_registry_update =
current_epoch - state.getValidator_registry_update_epoch();
=======
UnsignedLong epochs_since_last_registry_update =
current_epoch.minus(state.getValidator_registry_update_epoch());
>>>>>>>
UnsignedLong epochs_since_last_registry_update =
current_epoch.minus(state.getValidator_registry_update_epoch());
<<<<<<<
(state.getCurrent_shuffling_start_shard() + current_committees_per_epoch)
% Constants.SHARD_COUNT;
} else if (epochs_since_last_registry_update > 1
=======
state
.getCurrent_shuffling_start_shard()
.plus(current_committees_per_epoch)
.mod(UnsignedLong.valueOf(SHARD_COUNT));
} else if (epochs_since_last_registry_update.compareTo(UnsignedLong.ONE) > 0
>>>>>>>
state
.getCurrent_shuffling_start_shard()
.plus(current_committees_per_epoch)
.mod(UnsignedLong.valueOf(SHARD_COUNT));
} else if (epochs_since_last_registry_update.compareTo(UnsignedLong.ONE) > 0
<<<<<<<
long offset = slot % SLOTS_PER_EPOCH;
long committees_per_slot = committees_per_epoch / SLOTS_PER_EPOCH;
long slot_start_shard =
(shuffling_start_shard + committees_per_slot * offset) % Constants.SHARD_COUNT;
=======
UnsignedLong offset = slot.mod(UnsignedLong.valueOf(SLOTS_PER_EPOCH));
UnsignedLong committees_per_slot =
committees_per_epoch.dividedBy(UnsignedLong.valueOf(SLOTS_PER_EPOCH));
UnsignedLong slot_start_shard =
shuffling_start_shard
.plus(committees_per_slot.times(offset))
.mod(UnsignedLong.valueOf(Constants.SHARD_COUNT));
>>>>>>>
UnsignedLong offset = slot.mod(UnsignedLong.valueOf(SLOTS_PER_EPOCH));
UnsignedLong committees_per_slot =
committees_per_epoch.dividedBy(UnsignedLong.valueOf(SLOTS_PER_EPOCH));
UnsignedLong slot_start_shard =
shuffling_start_shard
.plus(committees_per_slot.times(offset))
.mod(UnsignedLong.valueOf(Constants.SHARD_COUNT));
<<<<<<<
(slot_start_shard + i) % Constants.SHARD_COUNT,
shuffling.get(toIntExact(committees_per_slot * offset + i) % shuffling.size()));
=======
slot_start_shard.plus(UnsignedLong.ONE).mod(UnsignedLong.valueOf(SHARD_COUNT)),
shuffling.get(
committees_per_slot.times(offset).plus(UnsignedLong.valueOf(i)).intValue()));
>>>>>>>
slot_start_shard.plus(UnsignedLong.ONE).mod(UnsignedLong.valueOf(SHARD_COUNT)),
shuffling.get(
committees_per_slot.times(offset).plus(UnsignedLong.valueOf(i)).intValue()));
<<<<<<<
* Returns the effective balance (also known as "balance at stake") for a validator with the given
* index.
*
* <p><b>Note:</b> This is a convenience method which is not defined in the spec.
*
* @param state - The BeaconState under consideration.
* @param record - The Validator to retrieve the balance for.
* @return The smaller of either the validator's balance at stake or MAX_DEPOSIT_AMOUNT.
*/
public static long get_effective_balance(BeaconState state, Validator record) {
int index = state.getValidator_registry().indexOf(record);
return get_effective_balance(state, index);
}
/**
=======
>>>>>>>
<<<<<<<
* Adds and returns the effective balances for the validators in the given CrossLinkCommittee.
*
* <p><b>Note:</b> This is a convenience method which is not defined in the spec.
*
* @param state - The current BeaconState.
* @param crosslink_committee - The CrosslinkCommittee with the committee of validators to get the
* total balance for.
* @return The combined effective balance of the list of validators.
*/
public static long get_total_balance(BeaconState state, CrosslinkCommittee crosslink_committee) {
return get_total_balance(state, crosslink_committee.getCommittee());
}
/**
=======
>>>>>>>
<<<<<<<
public static long get_total_balance(BeaconState state, List<Integer> validator_indices) {
long total_balance = 0;
for (Integer index : validator_indices) {
total_balance = total_balance + BeaconStateUtil.get_effective_balance(state, index);
=======
public static UnsignedLong get_total_balance(BeaconState state, List<Integer> validators) {
UnsignedLong total_balance = UnsignedLong.ZERO;
for (Integer index : validators) {
total_balance = total_balance.plus(BeaconStateUtil.get_effective_balance(state, index));
>>>>>>>
public static UnsignedLong get_total_balance(BeaconState state, List<Integer> validators) {
UnsignedLong total_balance = UnsignedLong.ZERO;
for (Integer index : validators) {
total_balance = total_balance.plus(BeaconStateUtil.get_effective_balance(state, index));
<<<<<<<
/**
* Return the previous epoch of the given state.
*
* @param state The beacon state under consideration.
* @return The previous epoch number for the given state.
* @see <a
* href="https://github.com/ethereum/eth2.0-specs/blob/v0.4.0/specs/core/0_beacon-chain.md#get_previous_epoch">get_previous_epoch
* - Spec v0.4</a>
*/
public static long get_previous_epoch(BeaconState state) {
long current_epoch_minus_one = get_current_epoch(state) - 1;
return Math.max(current_epoch_minus_one, GENESIS_EPOCH);
=======
/** Taken from 6.1 */
public static UnsignedLong get_previous_epoch(BeaconState state) {
UnsignedLong current_epoch_minus_one = get_current_epoch(state).minus(UnsignedLong.ONE);
if (current_epoch_minus_one.compareTo(UnsignedLong.valueOf(GENESIS_EPOCH)) < 0) {
return UnsignedLong.valueOf(GENESIS_EPOCH);
}
return current_epoch_minus_one;
>>>>>>>
/** Taken from 6.1 */
public static UnsignedLong get_previous_epoch(BeaconState state) {
UnsignedLong current_epoch_minus_one = get_current_epoch(state).minus(UnsignedLong.ONE);
if (current_epoch_minus_one.compareTo(UnsignedLong.valueOf(GENESIS_EPOCH)) < 0) {
return UnsignedLong.valueOf(GENESIS_EPOCH);
}
return current_epoch_minus_one;
<<<<<<<
long exit_epoch = get_entry_exit_effect_epoch(get_current_epoch(state));
=======
UnsignedLong delayed_activation_exit_epoch =
get_delayed_activation_exit_epoch(get_current_epoch(state));
>>>>>>>
UnsignedLong delayed_activation_exit_epoch =
get_delayed_activation_exit_epoch(get_current_epoch(state));
<<<<<<<
if (validator.getExit_epoch() <= exit_epoch) {
return;
=======
if (validator.getExit_epoch().compareTo(delayed_activation_exit_epoch) > 0) {
validator.setExit_epoch(delayed_activation_exit_epoch);
>>>>>>>
if (validator.getExit_epoch().compareTo(delayed_activation_exit_epoch) > 0) {
validator.setExit_epoch(delayed_activation_exit_epoch);
<<<<<<<
listSize));
int flip = (pivot - indexRet) % listSize;
=======
list_size));
int flip = (pivot - indexRet) % list_size;
>>>>>>>
list_size));
int flip = (pivot - indexRet) % list_size;
<<<<<<<
listSize));
=======
list_size));
>>>>>>>
list_size));
<<<<<<<
public static long get_domain(Fork fork, long epoch, int domain_type) {
return get_fork_version(fork, epoch) * 4294967296L + domain_type;
=======
public static UnsignedLong get_domain(Fork fork, UnsignedLong epoch, int domain_type) {
// TODO Investigate this further:
// We deviate from the spec, adding domain_type first then concatting fork version on to it.
// The spec does this in the opposite order. It smells a lot like an endianness problem.
// The question is, it is Java/us, or is it a spec bug.
return UnsignedLong.valueOf(
bytes_to_int(Bytes.wrap(int_to_bytes(domain_type, 4), get_fork_version(fork, epoch))));
>>>>>>>
public static UnsignedLong get_domain(Fork fork, UnsignedLong epoch, int domain_type) {
// TODO Investigate this further:
// We deviate from the spec, adding domain_type first then concatting fork version on to it.
// The spec does this in the opposite order. It smells a lot like an endianness problem.
// The question is, it is Java/us, or is it a spec bug.
return UnsignedLong.valueOf(
bytes_to_int(Bytes.wrap(int_to_bytes(domain_type, 4), get_fork_version(fork, epoch))));
<<<<<<<
public static long get_fork_version(Fork fork, long epoch) {
if (epoch < fork.getEpoch()) {
=======
public static Bytes get_fork_version(Fork fork, UnsignedLong epoch) {
if (epoch.compareTo(fork.getEpoch()) < 0) {
>>>>>>>
public static Bytes get_fork_version(Fork fork, UnsignedLong epoch) {
if (epoch.compareTo(fork.getEpoch()) < 0) {
<<<<<<<
for (CrosslinkCommittee curr_crosslink_committee : crosslink_committees) {
if (curr_crosslink_committee.getShard() == attestation_data.getShard()) {
crosslink_committee = curr_crosslink_committee;
=======
for (CrosslinkCommittee committee : crosslink_committees) {
if (committee.getShard().equals(attestation_data.getShard())) {
crosslink_committee = committee;
>>>>>>>
for (CrosslinkCommittee committee : crosslink_committees) {
if (committee.getShard().equals(attestation_data.getShard())) {
crosslink_committee = committee;
<<<<<<<
long source_epoch_1 = attestation_data_1.getJustified_epoch();
long source_epoch_2 = attestation_data_2.getJustified_epoch();
long target_epoch_1 = slot_to_epoch(attestation_data_1.getSlot());
long target_epoch_2 = slot_to_epoch(attestation_data_2.getSlot());
return source_epoch_1 < source_epoch_2 && target_epoch_2 < target_epoch_1;
=======
UnsignedLong source_epoch_1 = attestation_data_1.getSource_epoch();
UnsignedLong source_epoch_2 = attestation_data_2.getSource_epoch();
UnsignedLong target_epoch_1 = slot_to_epoch(attestation_data_1.getSlot());
UnsignedLong target_epoch_2 = slot_to_epoch(attestation_data_2.getSlot());
return source_epoch_1.compareTo(source_epoch_2) < 0
&& target_epoch_2.compareTo(target_epoch_1) < 0;
>>>>>>>
UnsignedLong source_epoch_1 = attestation_data_1.getSource_epoch();
UnsignedLong source_epoch_2 = attestation_data_2.getSource_epoch();
UnsignedLong target_epoch_1 = slot_to_epoch(attestation_data_1.getSlot());
UnsignedLong target_epoch_2 = slot_to_epoch(attestation_data_2.getSlot());
return source_epoch_1.compareTo(source_epoch_2) < 0
&& target_epoch_2.compareTo(target_epoch_1) < 0; |
<<<<<<<
for(PathEdge<N, AbstractionWithSourceStmt<N, D>> pausedEdge: pausedEdges) {
logger.debug("-- UNPAUSE {}: {}",debugName, pausedEdge);
=======
for(PathEdge<N, AbstractionWithSourceStmt> pausedEdge: pausedEdges) {
if(DEBUG)
System.err.println("-- UNPAUSE "+debugName+": "+pausedEdge);
>>>>>>>
for(PathEdge<N, AbstractionWithSourceStmt> pausedEdge: pausedEdges) {
if(DEBUG)
logger.debug("-- UNPAUSE {}: {}",debugName, pausedEdge); |
<<<<<<<
protected void processCall(PathEdge<N,D,M> edge) {
=======
private void processCall(PathEdge<N,D> edge) {
>>>>>>>
private void processCall(PathEdge<N,D> edge) {
<<<<<<<
protected void processExit(PathEdge<N,D,M> edge) {
=======
private void processExit(PathEdge<N,D> edge) {
>>>>>>>
protected void processExit(PathEdge<N,D> edge) {
<<<<<<<
protected void processNormalFlow(PathEdge<N,D,M> edge) {
=======
private void processNormalFlow(PathEdge<N,D> edge) {
>>>>>>>
private void processNormalFlow(PathEdge<N,D> edge) { |
<<<<<<<
import de.codecentric.spring.boot.chaos.monkey.component.MetricType;
import de.codecentric.spring.boot.chaos.monkey.component.Metrics;
=======
import de.codecentric.spring.boot.chaos.monkey.configuration.AssaultProperties;
import de.codecentric.spring.boot.chaos.monkey.configuration.ChaosMonkeySettings;
import java.util.Collections;
import java.util.List;
>>>>>>>
import de.codecentric.spring.boot.chaos.monkey.component.MetricType;
import de.codecentric.spring.boot.chaos.monkey.component.Metrics;
<<<<<<<
LOGGER.debug(LOGGER.isDebugEnabled() ? "Controller class and public method detected: " + pjp.getSignature() : null);
// metrics
if (metrics != null) {
metrics.counterWatcher(MetricType.SERVICE, calculatePointcut(pjp.toShortString())).increment();
}
=======
final Signature signature = pjp.getSignature();
LOGGER.debug(LOGGER.isDebugEnabled() ? "Controller class and public method detected: " + signature : null);
>>>>>>>
LOGGER.debug(LOGGER.isDebugEnabled() ? "Controller class and public method detected: " + pjp.getSignature() : null);
// metrics
if (metrics != null) {
metrics.counterWatcher(MetricType.SERVICE, calculatePointcut(pjp.toShortString())).increment();
}
final Signature signature = pjp.getSignature();
LOGGER.debug(LOGGER.isDebugEnabled() ? "Controller class and public method detected: " + signature : null); |
<<<<<<<
LOGGER.debug(LOGGER.isDebugEnabled() ? "Repository class and public method detected: " + pjp.getSignature() : null);
// metrics
if (metrics != null)
metrics.counter(MetricType.REPOSITORY, calculatePointcut(pjp.toShortString())).increment();
=======
MethodSignature signature = (MethodSignature) pjp.getSignature();
>>>>>>>
LOGGER.debug(LOGGER.isDebugEnabled() ? "Repository class and public method detected: " + pjp.getSignature() : null);
// metrics
if (metrics != null)
metrics.counter(MetricType.REPOSITORY, calculatePointcut(pjp.toShortString())).increment();
MethodSignature signature = (MethodSignature) pjp.getSignature(); |
<<<<<<<
=======
@Mock
private ChaosMonkeySettings chaosMonkeySettings;
>>>>>>> |
<<<<<<<
@Autowired private ChaosMonkeyRequestScope chaosMonkeyRequestScope;
@Autowired private ChaosMonkeySettings monkeySettings;
@Autowired private LatencyAssault latencyAssault;
@Autowired private ExceptionAssault exceptionAssault;
@Autowired private KillAppAssault killAppAssault;
@Mock private MetricEventPublisher metricsMock;
@BeforeEach
void setUp() {
chaosMonkeyRequestScope =
new ChaosMonkeyRequestScope(
monkeySettings,
Arrays.asList(latencyAssault, exceptionAssault),
Collections.emptyList(),
metricsMock);
}
@Test
void contextLoads() {
assertNotNull(chaosMonkeyRequestScope);
}
@Test
void checkChaosSettingsObject() {
assertNotNull(monkeySettings);
}
@Test
void checkChaosSettingsValues() {
assertThat(monkeySettings.getChaosMonkeyProperties().isEnabled(), is(false));
assertThat(monkeySettings.getAssaultProperties().getLatencyRangeEnd(), is(50));
assertThat(monkeySettings.getAssaultProperties().getLatencyRangeStart(), is(10));
assertThat(monkeySettings.getAssaultProperties().getLevel(), is(1));
assertThat(monkeySettings.getAssaultProperties().isLatencyActive(), is(true));
assertThat(monkeySettings.getAssaultProperties().isExceptionsActive(), is(false));
assertThat(monkeySettings.getAssaultProperties().isKillApplicationActive(), is(true));
assertThat(monkeySettings.getAssaultProperties().getWatchedCustomServices(), is(nullValue()));
assertThat(monkeySettings.getWatcherProperties().isController(), is(true));
assertThat(monkeySettings.getWatcherProperties().isRepository(), is(false));
assertThat(monkeySettings.getWatcherProperties().isRestController(), is(false));
assertThat(monkeySettings.getWatcherProperties().isService(), is(true));
}
=======
@Autowired
private ChaosMonkeyRequestScope chaosMonkeyRequestScope;
@Autowired
private ChaosMonkeySettings monkeySettings;
@Autowired
private LatencyAssault latencyAssault;
@Autowired
private ExceptionAssault exceptionAssault;
@Autowired
private KillAppAssault killAppAssault;
@Mock
private MetricEventPublisher metricsMock;
@BeforeEach
void setUp() {
chaosMonkeyRequestScope = new ChaosMonkeyRequestScope(monkeySettings, Arrays.asList(latencyAssault, exceptionAssault), Collections.emptyList(), metricsMock);
}
@Test
void contextLoads() {
assertNotNull(chaosMonkeyRequestScope);
}
@Test
void checkChaosSettingsObject() {
assertNotNull(monkeySettings);
}
@Test
void checkChaosSettingsValues() {
assertThat(monkeySettings.getChaosMonkeyProperties().isEnabled(), is(false));
assertThat(monkeySettings.getAssaultProperties().getLatencyRangeEnd(), is(50));
assertThat(monkeySettings.getAssaultProperties().getLatencyRangeStart(), is(10));
assertThat(monkeySettings.getAssaultProperties().getLevel(), is(1));
assertThat(monkeySettings.getAssaultProperties().isLatencyActive(), is(false));
assertThat(monkeySettings.getAssaultProperties().isExceptionsActive(), is(false));
assertThat(monkeySettings.getAssaultProperties().isKillApplicationActive(), is(true));
assertThat(monkeySettings.getAssaultProperties().getWatchedCustomServices(), is(nullValue()));
assertThat(monkeySettings.getWatcherProperties().isController(), is(true));
assertThat(monkeySettings.getWatcherProperties().isRepository(), is(false));
assertThat(monkeySettings.getWatcherProperties().isRestController(), is(false));
assertThat(monkeySettings.getWatcherProperties().isService(), is(false));
}
>>>>>>>
@Autowired private ChaosMonkeyRequestScope chaosMonkeyRequestScope;
@Autowired private ChaosMonkeySettings monkeySettings;
@Autowired private LatencyAssault latencyAssault;
@Autowired private ExceptionAssault exceptionAssault;
@Autowired private KillAppAssault killAppAssault;
@Mock private MetricEventPublisher metricsMock;
@BeforeEach
void setUp() {
chaosMonkeyRequestScope =
new ChaosMonkeyRequestScope(
monkeySettings,
Arrays.asList(latencyAssault, exceptionAssault),
Collections.emptyList(),
metricsMock);
}
@Test
void contextLoads() {
assertNotNull(chaosMonkeyRequestScope);
}
@Test
void checkChaosSettingsObject() {
assertNotNull(monkeySettings);
}
@Test
void checkChaosSettingsValues() {
assertThat(monkeySettings.getChaosMonkeyProperties().isEnabled(), is(false));
assertThat(monkeySettings.getAssaultProperties().getLatencyRangeEnd(), is(50));
assertThat(monkeySettings.getAssaultProperties().getLatencyRangeStart(), is(10));
assertThat(monkeySettings.getAssaultProperties().getLevel(), is(1));
assertThat(monkeySettings.getAssaultProperties().isLatencyActive(), is(false));
assertThat(monkeySettings.getAssaultProperties().isExceptionsActive(), is(false));
assertThat(monkeySettings.getAssaultProperties().isKillApplicationActive(), is(true));
assertThat(monkeySettings.getAssaultProperties().getWatchedCustomServices(), is(nullValue()));
assertThat(monkeySettings.getWatcherProperties().isController(), is(true));
assertThat(monkeySettings.getWatcherProperties().isRepository(), is(false));
assertThat(monkeySettings.getWatcherProperties().isRestController(), is(false));
assertThat(monkeySettings.getWatcherProperties().isService(), is(false));
} |
<<<<<<<
=======
import de.codecentric.spring.boot.chaos.monkey.configuration.ChaosMonkeySettings;
import de.codecentric.spring.boot.demo.chaos.monkey.controller.DemoController;
>>>>>>>
<<<<<<<
=======
@Mock
private ChaosMonkeySettings chaosMonkeySettings;
>>>>>>> |
<<<<<<<
import com.capitalone.dashboard.service.ApiTokenService;
import com.capitalone.dashboard.service.ApiTokenServiceImpl;
import com.capitalone.dashboard.service.AuthenticationService;
import com.capitalone.dashboard.service.BinaryArtifactService;
import com.capitalone.dashboard.service.BuildService;
import com.capitalone.dashboard.service.BusCompOwnerService;
import com.capitalone.dashboard.service.CloudInstanceService;
import com.capitalone.dashboard.service.CloudSubnetService;
import com.capitalone.dashboard.service.CloudVirtualNetworkService;
import com.capitalone.dashboard.service.CloudVolumeService;
import com.capitalone.dashboard.service.CmdbService;
import com.capitalone.dashboard.service.CodeQualityService;
import com.capitalone.dashboard.service.CollectorService;
import com.capitalone.dashboard.service.CommitService;
import com.capitalone.dashboard.service.ConfigurationService;
import com.capitalone.dashboard.service.DashboardRemoteService;
import com.capitalone.dashboard.service.DashboardService;
import com.capitalone.dashboard.service.DefaultAuthenticationServiceImpl;
import com.capitalone.dashboard.service.DeployService;
import com.capitalone.dashboard.service.EncryptionService;
import com.capitalone.dashboard.service.FeatureService;
import com.capitalone.dashboard.service.GitRequestService;
import com.capitalone.dashboard.service.LibraryPolicyService;
import com.capitalone.dashboard.service.MaturityModelService;
import com.capitalone.dashboard.service.Monitor2Service;
import com.capitalone.dashboard.service.PerformanceService;
import com.capitalone.dashboard.service.PipelineService;
import com.capitalone.dashboard.service.RallyFeatureService;
import com.capitalone.dashboard.service.ScopeService;
import com.capitalone.dashboard.service.ServiceService;
import com.capitalone.dashboard.service.TeamService;
import com.capitalone.dashboard.service.TemplateService;
import com.capitalone.dashboard.service.TestResultService;
import com.capitalone.dashboard.service.UserInfoService;
import com.capitalone.dashboard.service.UserInfoServiceImpl;
=======
import com.capitalone.dashboard.service.*;
>>>>>>>
import com.capitalone.dashboard.service.ApiTokenService;
import com.capitalone.dashboard.service.ApiTokenServiceImpl;
import com.capitalone.dashboard.service.AuthenticationService;
import com.capitalone.dashboard.service.BinaryArtifactService;
import com.capitalone.dashboard.service.BuildService;
import com.capitalone.dashboard.service.BusCompOwnerService;
import com.capitalone.dashboard.service.CloudInstanceService;
import com.capitalone.dashboard.service.CloudSubnetService;
import com.capitalone.dashboard.service.CloudVirtualNetworkService;
import com.capitalone.dashboard.service.CloudVolumeService;
import com.capitalone.dashboard.service.CmdbService;
import com.capitalone.dashboard.service.CodeQualityService;
import com.capitalone.dashboard.service.CollectorService;
import com.capitalone.dashboard.service.CommitService;
import com.capitalone.dashboard.service.ConfigurationService;
import com.capitalone.dashboard.service.DashboardRemoteService;
import com.capitalone.dashboard.service.DashboardService;
import com.capitalone.dashboard.service.DefaultAuthenticationServiceImpl;
import com.capitalone.dashboard.service.DeployService;
import com.capitalone.dashboard.service.EncryptionService;
import com.capitalone.dashboard.service.FeatureService;
import com.capitalone.dashboard.service.GitRequestService;
import com.capitalone.dashboard.service.LibraryPolicyService;
import com.capitalone.dashboard.service.MaturityModelService;
import com.capitalone.dashboard.service.Monitor2Service;
import com.capitalone.dashboard.service.PerformanceService;
import com.capitalone.dashboard.service.PipelineService;
import com.capitalone.dashboard.service.RallyFeatureService;
import com.capitalone.dashboard.service.ScopeService;
import com.capitalone.dashboard.service.ServiceService;
import com.capitalone.dashboard.service.TeamService;
import com.capitalone.dashboard.service.TemplateService;
import com.capitalone.dashboard.service.TestResultService;
import com.capitalone.dashboard.service.UserInfoService;
import com.capitalone.dashboard.service.UserInfoServiceImpl;
import com.capitalone.dashboard.service.*; |
<<<<<<<
import android.os.SystemProperties;
=======
import android.os.Vibrator;
>>>>>>>
import android.os.SystemProperties;
import android.os.Vibrator; |
<<<<<<<
=======
import android.support.annotation.RequiresApi;
import net.sqlcipher.DatabaseErrorHandler;
>>>>>>>
import net.sqlcipher.DatabaseErrorHandler;
<<<<<<<
import androidx.annotation.RequiresApi;
import androidx.sqlite.db.SupportSQLiteDatabase;
import androidx.sqlite.db.SupportSQLiteOpenHelper;
=======
>>>>>>>
import androidx.annotation.RequiresApi;
import androidx.sqlite.db.SupportSQLiteDatabase;
import androidx.sqlite.db.SupportSQLiteOpenHelper;
<<<<<<<
synchronized public String getDatabaseName() {
return name;
// TODO not supported in SQLCipher for Android
// throw new UnsupportedOperationException("I kinna do it, cap'n!");
// return delegate.getDatabaseName();
=======
synchronized public String getDatabaseName() {
return delegate.getDatabaseName();
>>>>>>>
synchronized public String getDatabaseName() {
return delegate.getDatabaseName();
<<<<<<<
synchronized public void setWriteAheadLoggingEnabled(boolean enabled) {
// throw new UnsupportedOperationException("I kinna do it, cap'n!");
=======
synchronized public void setWriteAheadLoggingEnabled(boolean enabled) {
>>>>>>>
synchronized public void setWriteAheadLoggingEnabled(boolean enabled) {
<<<<<<<
abstract static class OpenHelper extends SQLiteOpenHelper {
private volatile Database wrappedDb;
private volatile Boolean walEnabled;
=======
static class OpenHelper extends SQLiteOpenHelper {
private final Database[] dbRef;
private volatile Callback callback;
private volatile boolean migrated;
OpenHelper(Context context, String name, Database[] dbRef, Callback callback,
String postKeySql) {
super(context, name, null, callback.version, new SQLiteDatabaseHook() {
@Override
public void preKey(SQLiteDatabase database) {
// no-op
}
>>>>>>>
static class OpenHelper extends SQLiteOpenHelper {
private final Database[] dbRef;
private volatile Callback callback;
private volatile boolean migrated;
OpenHelper(Context context, String name, Database[] dbRef, Callback callback,
String postKeySql) {
super(context, name, null, callback.version, new SQLiteDatabaseHook() {
@Override
public void preKey(SQLiteDatabase database) {
// no-op
}
<<<<<<<
synchronized SupportSQLiteDatabase getWritableSupportDatabase(char[] passphrase) {
=======
synchronized SupportSQLiteDatabase getWritableSupportDatabase(char[] passphrase) {
migrated = false;
>>>>>>>
synchronized SupportSQLiteDatabase getWritableSupportDatabase(char[] passphrase) {
migrated = false; |
<<<<<<<
private Attributes versionClientLibs(final String elementName, final Attributes attrs, final String contextPath) {
if (SAXElementUtils.isCSS(elementName, attrs)) {
=======
private Attributes versionClientLibs(final String elementName, final Attributes attrs, final SlingHttpServletRequest request) {
if (this.isCSS(elementName, attrs)) {
>>>>>>>
private Attributes versionClientLibs(final String elementName, final Attributes attrs, final SlingHttpServletRequest request) {
if (SAXElementUtils.isCSS(elementName, attrs)) {
<<<<<<<
private String getVersionedPath(final String originalPath, final LibraryType libraryType) {
=======
private boolean isCSS(final String elementName, final Attributes attrs) {
final String type = attrs.getValue("", "type");
final String href = attrs.getValue("", "href");
if (StringUtils.equals("link", elementName)
&& StringUtils.equals(type, CSS_TYPE)
&& StringUtils.startsWith(href, "/")
&& !StringUtils.startsWith(href, "//")
&& StringUtils.endsWith(href, LibraryType.CSS.extension)) {
return true;
}
return false;
}
private boolean isJavaScript(final String elementName, final Attributes attrs) {
final String type = attrs.getValue("", "type");
final String src = attrs.getValue("", "src");
if (StringUtils.equals("script", elementName)
&& StringUtils.equals(type, JS_TYPE)
&& StringUtils.startsWith(src, "/")
&& !StringUtils.startsWith(src, "//")
&& StringUtils.endsWith(src, LibraryType.JS.extension)) {
return true;
}
return false;
}
private String getVersionedPath(final String originalPath, final LibraryType libraryType, final ResourceResolver resourceResolver) {
>>>>>>>
private String getVersionedPath(final String originalPath, final LibraryType libraryType, final ResourceResolver resourceResolver) { |
<<<<<<<
private Attributes versionClientLibs(final String elementName, final Attributes attrs) {
if (SAXElementUtils.isCSS(elementName, attrs)) {
=======
private Attributes versionClientLibs(final String elementName, final Attributes attrs, final String contextPath) {
if (this.isCSS(elementName, attrs)) {
>>>>>>>
private Attributes versionClientLibs(final String elementName, final Attributes attrs, final String contextPath) {
if (SAXElementUtils.isCSS(elementName, attrs)) { |
<<<<<<<
import java.util.HashSet;
import java.util.Set;
=======
import aQute.bnd.annotation.ProviderType;
import com.day.cq.commons.Externalizer;
import com.day.cq.wcm.api.AuthoringUIMode;
import com.day.cq.wcm.api.WCMMode;
import org.apache.felix.scr.annotations.Activate;
import org.apache.felix.scr.annotations.Component;
import org.apache.felix.scr.annotations.Reference;
>>>>>>>
import java.util.HashSet;
import java.util.Set;
import org.apache.felix.scr.annotations.Component;
<<<<<<<
import com.day.cq.commons.Externalizer;
import com.day.cq.wcm.api.AuthoringUIMode;
import com.day.cq.wcm.api.WCMMode;
=======
import java.util.HashSet;
import java.util.Set;
@ProviderType
@Component(immediate = true)
>>>>>>>
import com.day.cq.commons.Externalizer;
import com.day.cq.wcm.api.AuthoringUIMode;
import com.day.cq.wcm.api.WCMMode;
import aQute.bnd.annotation.ProviderType;
@ProviderType
@Component(immediate = true) |
<<<<<<<
import com.day.cq.dam.api.Asset;
=======
import com.adobe.granite.workflow.exec.Workflow;
>>>>>>>
import com.day.cq.dam.api.Asset;
<<<<<<<
import com.day.cq.workflow.exec.WorkItem;
import com.day.cq.workflow.metadata.MetaDataMap;
=======
import com.day.cq.workflow.exec.WorkflowData;
>>>>>>>
import com.day.cq.workflow.exec.WorkItem;
import com.day.cq.workflow.metadata.MetaDataMap;
import com.day.cq.workflow.exec.WorkflowData;
<<<<<<<
String TYPE_JCR_PATH = "JCR_PATH";
=======
String PAYLOAD_TYPE_JCR_PATH = "JCR_PATH";
>>>>>>>
String TYPE_JCR_PATH = "JCR_PATH";
String PAYLOAD_TYPE_JCR_PATH = "JCR_PATH";
<<<<<<<
/**
* Resolve the asset for the workflow's payload and return it, along with a resolved resource resolver.
*
* @param item the workflow workitem
* @param workflowSession the workflow session
* @return a tuple containing the asset and resource resolver or null if the asset cannot be resolved
*/
WorkflowHelper.AssetResourceResolverPair getAssetFromPayload(WorkItem item, WorkflowSession workflowSession);
/**
* Return the extension corresponding to the mime type.
*
* @param mimetype the mimetype
* @return the corresponding extension
*/
String getExtension(String mimetype);
/**
* Build an arguments array from the metadata map.
*
* @param metaData the metadata maps
* @return the values array
*/
String[] buildArguments(MetaDataMap metaData);
/**
* Parse a workflow args string in the formaat >name<:>value<,>name<:>value< and
* extract the values with the specified name.
*
* @param name the argument name
* @param args the arguments array
* @return the values list
*/
List<String> getValuesFromArgs(String name, String args[]);
/**
* Parse the provided quality string, from 1 to 100, and
* apply it to the base. Allows for a constant scale to be used
* and applied to different image types which support different
* quality scales.
*
* @param base the maximal quality value
* @param qualityStr the string to parse
* @return a usable quality value
*/
double getQuality(double base, String qualityStr);
/**
* A simple tuple which contains a resolved asset and a resource resolver, so that the resource resolver
* can later be closed.
*/
final class AssetResourceResolverPair {
public final Asset asset;
public final ResourceResolver resourceResolver;
public AssetResourceResolverPair(Asset asset, ResourceResolver resourceResolver) {
this.asset = asset;
this.resourceResolver = resourceResolver;
}
}
=======
/**
* Derives either an Asset or Page resource (dam:Asset or cq:Page) that the provided path belongs to.
* Example: When path = /content/dam/foo.png/jcr:content/renditions/original, this method will return the resource at /content/dam/foo.png
* Example: When path = /content/site/bar/jcr:content/root/text, this method will return the resource at /content/site/bar
* @param resourceResolver the resourceResolver to resolve the path to the appropriate resource
* @param path the path to resolve to an Asset or Page
* @return the resource representing the resolver dam:Asset or cq:Page, if neither can be resolved, null is returned.
*/
Resource getPageOrAssetResource(ResourceResolver resourceResolver, String path);
/**
* Method for CQ Workflow APIs.
* @param workflowData the Workflow data
* @return true of the WorkflowData payload is of type JCR_PATH
*/
boolean isPathTypedPayload(WorkflowData workflowData);
/**
* Method for Granite Workflow APIs.
* @param workflowData the Workflow data
* @return true of the WorkflowData payload is of type JCR_PATH
*/
boolean isPathTypedPayload(com.adobe.granite.workflow.exec.WorkflowData workflowData);
>>>>>>>
/**
* Resolve the asset for the workflow's payload and return it, along with a resolved resource resolver.
*
* @param item the workflow workitem
* @param workflowSession the workflow session
* @return a tuple containing the asset and resource resolver or null if the asset cannot be resolved
*/
WorkflowHelper.AssetResourceResolverPair getAssetFromPayload(WorkItem item, WorkflowSession workflowSession);
/**
* Return the extension corresponding to the mime type.
*
* @param mimetype the mimetype
* @return the corresponding extension
*/
String getExtension(String mimetype);
/**
* Build an arguments array from the metadata map.
*
* @param metaData the metadata maps
* @return the values array
*/
String[] buildArguments(MetaDataMap metaData);
/**
* Parse a workflow args string in the formaat >name<:>value<,>name<:>value< and
* extract the values with the specified name.
*
* @param name the argument name
* @param args the arguments array
* @return the values list
*/
List<String> getValuesFromArgs(String name, String args[]);
/**
* Parse the provided quality string, from 1 to 100, and
* apply it to the base. Allows for a constant scale to be used
* and applied to different image types which support different
* quality scales.
*
* @param base the maximal quality value
* @param qualityStr the string to parse
* @return a usable quality value
*/
double getQuality(double base, String qualityStr);
/**
* A simple tuple which contains a resolved asset and a resource resolver, so that the resource resolver
* can later be closed.
*/
final class AssetResourceResolverPair {
public final Asset asset;
public final ResourceResolver resourceResolver;
public AssetResourceResolverPair(Asset asset, ResourceResolver resourceResolver) {
this.asset = asset;
this.resourceResolver = resourceResolver;
}
}
/**
* Derives either an Asset or Page resource (dam:Asset or cq:Page) that the provided path belongs to.
* Example: When path = /content/dam/foo.png/jcr:content/renditions/original, this method will return the resource at /content/dam/foo.png
* Example: When path = /content/site/bar/jcr:content/root/text, this method will return the resource at /content/site/bar
* @param resourceResolver the resourceResolver to resolve the path to the appropriate resource
* @param path the path to resolve to an Asset or Page
* @return the resource representing the resolver dam:Asset or cq:Page, if neither can be resolved, null is returned.
*/
Resource getPageOrAssetResource(ResourceResolver resourceResolver, String path);
/**
* Method for CQ Workflow APIs.
* @param workflowData the Workflow data
* @return true of the WorkflowData payload is of type JCR_PATH
*/
boolean isPathTypedPayload(WorkflowData workflowData);
/**
* Method for Granite Workflow APIs.
* @param workflowData the Workflow data
* @return true of the WorkflowData payload is of type JCR_PATH
*/
boolean isPathTypedPayload(com.adobe.granite.workflow.exec.WorkflowData workflowData); |
<<<<<<<
import org.apache.sling.xss.XSSAPI;
=======
import com.adobe.granite.xss.XSSAPI;
import com.day.cq.wcm.api.WCMMode;
>>>>>>>
import org.apache.sling.xss.XSSAPI;
import com.day.cq.wcm.api.WCMMode; |
<<<<<<<
import com.adobe.acs.commons.errorpagehandler.ErrorPageHandlerService;
import com.adobe.acs.commons.wcm.ComponentHelper;
import com.day.cq.commons.PathInfo;
import com.day.cq.search.PredicateGroup;
import com.day.cq.search.Query;
import com.day.cq.search.QueryBuilder;
import com.day.cq.search.eval.JcrPropertyPredicateEvaluator;
import com.day.cq.search.eval.NodenamePredicateEvaluator;
import com.day.cq.search.eval.TypePredicateEvaluator;
import com.day.cq.search.result.Hit;
import com.day.cq.search.result.SearchResult;
import com.day.cq.wcm.api.NameConstants;
=======
import javax.jcr.Node;
import javax.jcr.RepositoryException;
import javax.jcr.Session;
import javax.servlet.ServletException;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.util.AbstractMap.SimpleEntry;
import java.util.*;
>>>>>>>
import com.adobe.acs.commons.errorpagehandler.ErrorPageHandlerService;
import com.adobe.acs.commons.wcm.ComponentHelper;
import com.day.cq.commons.PathInfo;
import com.day.cq.commons.inherit.HierarchyNodeInheritanceValueMap;
import com.day.cq.commons.inherit.InheritanceValueMap;
import com.day.cq.search.QueryBuilder;
<<<<<<<
* Create the query for finding candidate cq:Pages
*
* @param resourceResolver
* @param pageNames
* @return
*/
private SearchResult executeQuery(ResourceResolver resourceResolver, String... pageNames) {
final Session session = resourceResolver.adaptTo(Session.class);
final Map<String, String> map = new HashMap<String, String>();
if (pageNames == null) {
pageNames = new String[] {};
}
// Construct query builder query
map.put(TypePredicateEvaluator.TYPE, "cq:Page");
if (pageNames.length == 1) {
map.put(NodenamePredicateEvaluator.NODENAME, escapeNodeName(pageNames[0]));
} else if (pageNames.length > 1) {
map.put("group.p.or", "true");
for (int i = 0; i < pageNames.length; i++) {
map.put("group." + String.valueOf(i) + "_" + NodenamePredicateEvaluator.NODENAME,
escapeNodeName(pageNames[i]));
}
}
final Query query = queryBuilder.createQuery(PredicateGroup.create(map), session);
return query.getResult();
}
/**
=======
>>>>>>>
<<<<<<<
* Find the Error page search path that best contains the provided resource
*
* @param resource
* @return
*/
private String getErrorPagesPath(Resource resource, SortedMap<String, String> errorPagesMap) {
// Path to evaluate against Root paths
final String path = resource.getPath();
final ResourceResolver resourceResolver = resource.getResourceResolver();
for (final String rootPath : this.getRootPaths(errorPagesMap)) {
if (StringUtils.equals(path, rootPath) || StringUtils.startsWith(path, rootPath.concat("/"))) {
final String errorPagePath = getErrorPagesPath(rootPath, errorPagesMap);
Resource errorPageResource = getResource(resourceResolver, errorPagePath);
if (errorPageResource != null && !ResourceUtil.isNonExistingResource(errorPageResource)) {
return errorPageResource.getPath();
}
}
}
return null;
}
/**
=======
>>>>>>>
<<<<<<<
@Override
public void resetRequestAndResponse(SlingHttpServletRequest request, SlingHttpServletResponse response,
int statusCode) {
=======
public void resetRequestAndResponse(SlingHttpServletRequest request, SlingHttpServletResponse response, int statusCode) {
>>>>>>>
public void resetRequestAndResponse(SlingHttpServletRequest request, SlingHttpServletResponse response, int statusCode) {
<<<<<<<
* Merge two Maps together. In the event of any key collisions the Master map wins
*
* Any blank value keys are dropped from the final Map
*
* Map is sorted by value (String) length
*
* @param master
* @param slave
* @return
*/
private SortedMap<String, String> mergeMaps(SortedMap<String, String> master, SortedMap<String, String> slave) {
SortedMap<String, String> map = new TreeMap<String, String>(new StringLengthComparator());
for (final Map.Entry<String, String> masterEntry : master.entrySet()) {
if (StringUtils.isNotBlank(masterEntry.getValue())) {
map.put(masterEntry.getKey(), masterEntry.getValue());
}
}
for (final Map.Entry<String, String> slaveEntry : slave.entrySet()) {
if (master.containsKey(slaveEntry.getKey())) {
continue;
}
if (StringUtils.isNotBlank(slaveEntry.getValue())) {
map.put(slaveEntry.getKey(), slaveEntry.getValue());
}
}
return map;
}
/**
=======
>>>>>>> |
<<<<<<<
import java.io.IOException;
import java.util.HashSet;
=======
import org.apache.commons.lang.StringUtils;
import org.apache.felix.scr.annotations.sling.SlingServlet;
import org.apache.sling.api.SlingHttpServletRequest;
import org.apache.sling.api.SlingHttpServletResponse;
import org.apache.sling.api.servlets.SlingSafeMethodsServlet;
import org.apache.sling.commons.json.JSONException;
import org.apache.sling.commons.json.io.JSONWriter;
>>>>>>>
import java.util.HashSet;
import org.apache.commons.lang.StringUtils;
import org.apache.felix.scr.annotations.sling.SlingServlet;
import org.apache.sling.api.SlingHttpServletRequest;
import org.apache.sling.api.SlingHttpServletResponse;
import org.apache.sling.api.servlets.SlingSafeMethodsServlet;
import org.apache.sling.commons.json.JSONException;
import org.apache.sling.commons.json.io.JSONWriter;
<<<<<<<
import org.apache.felix.scr.annotations.Component;
import org.apache.felix.scr.annotations.Properties;
import org.apache.felix.scr.annotations.Service;
import org.apache.jackrabbit.util.Text;
import org.apache.sling.api.SlingHttpServletRequest;
import org.apache.sling.api.SlingHttpServletResponse;
import org.apache.sling.api.servlets.SlingSafeMethodsServlet;
import org.apache.sling.commons.json.JSONException;
import org.apache.sling.commons.json.io.JSONWriter;
=======
import java.io.IOException;
>>>>>>>
import org.apache.felix.scr.annotations.Component;
import org.apache.felix.scr.annotations.Properties;
import org.apache.felix.scr.annotations.Service;
import org.apache.jackrabbit.util.Text;
import org.apache.sling.api.SlingHttpServletRequest;
import org.apache.sling.api.SlingHttpServletResponse;
import org.apache.sling.api.servlets.SlingSafeMethodsServlet;
import org.apache.sling.commons.json.JSONException;
import org.apache.sling.commons.json.io.JSONWriter;
<<<<<<<
Session session = request.getResourceResolver().adaptTo(Session.class);
//String path = request.getParameter("path");
=======
response.setHeader("Content-Disposition", "filename=" + "jcr-compare-dump.json");
String path = request.getParameter("path");
Session session = request.getResourceResolver().adaptTo(Session.class);
String filename;
if (StringUtils.isBlank(path)) {
filename = "unknown_path";
} else {
filename = StringUtils.replace(path, "/", "_");
}
response.setHeader("Content-Disposition", "filename=jcr-checksum" + filename + ".json");
>>>>>>>
response.setHeader("Content-Disposition", "filename=" + "jcr-compare-dump.json");
String path = request.getParameter("path");
Session session = request.getResourceResolver().adaptTo(Session.class);
String filename;
if (StringUtils.isBlank(path)) {
filename = "unknown_path";
} else {
filename = StringUtils.replace(path, "/", "_");
}
response.setHeader("Content-Disposition", "filename=jcr-checksum" + filename + ".json");
<<<<<<<
JSONGenerator.generateJSON(session, sip.getPaths(), sip.getChecksumGeneratorOptions(), jsonWriter);
//collectJSON(session.getRootNode().getNode("." + path), jsonWriter,
// response, sip.getChecksumGeneratorOptions());
=======
this.collectJSON(session.getRootNode().getNode("." + path), jsonWriter);
} catch (JSONVisitorException e) {
throw new ServletException("Unable to create value JSON object", e);
} catch (PathNotFoundException e) {
throw new ServletException("Unable to find path at: " + path, e);
>>>>>>>
JSONGenerator.generateJSON(session, sip.getPaths(), sip.getChecksumGeneratorOptions(), jsonWriter);
//collectJSON(session.getRootNode().getNode("." + path), jsonWriter,
// response, sip.getChecksumGeneratorOptions());
throw new ServletException("Unable to create value JSON object", e);
} catch (PathNotFoundException e) {
throw new ServletException("Unable to find path at: " + path, e);
<<<<<<<
private SlingHttpServletResponse response;
private ChecksumGeneratorOptions opts;
private HashSet<String> excludedPaths = new HashSet<String>();
public JSONVisitor(JSONWriter jsonWriter,
SlingHttpServletResponse response,
ChecksumGeneratorOptions opts) {
=======
public JSONVisitor(final JSONWriter jsonWriter) {
>>>>>>>
private ChecksumGeneratorOptions opts;
private HashSet<String> excludedPaths = new HashSet<String>();
public JSONVisitor(final JSONWriter jsonWriter) {
ChecksumGeneratorOptions opts) {
<<<<<<<
this.response = response;
this.opts = opts;
=======
>>>>>>>
this.opts = opts;
<<<<<<<
String path = node.getPath();
for(int i = 1; !Text.getRelativeParent(path, i).equals(""); i++) {
if(excludedPaths.contains(Text.getRelativeParent(path, i))) {
return;
}
}
if(opts.getNodeTypeExcludes().contains(node.getPrimaryNodeType().getName())) {
excludedPaths.add(node.getPath());
} else {
// response.getWriter().println("\nentering node: " +node.getPath() );
jsonWriter.key(node.getName()).object();
}
} catch (Exception e) {
try {
response.getWriter().println(
"\nERROR: entering node=" + node.getPath() + " "
+ e.getMessage());
} catch (IOException io) {
}
=======
jsonWriter.key(node.getName()).object();
} catch (JSONException e) {
throw new JSONVisitorException(e);
>>>>>>>
for(int i = 1; !Text.getRelativeParent(path, i).equals(""); i++) {
if(excludedPaths.contains(Text.getRelativeParent(path, i))) {
return;
}
}
if(opts.getNodeTypeExcludes().contains(node.getPrimaryNodeType().getName())) {
excludedPaths.add(node.getPath());
} else {
// response.getWriter().println("\nentering node: " +node.getPath() );
jsonWriter.key(node.getName()).object();
jsonWriter.key(node.getName()).object();
} catch (JSONException e) {
throw new JSONVisitorException(e);
<<<<<<<
// response.getWriter().println("\nentering prop: " +
// property.getPath() );
if (!opts.getPropertyExcludes().contains(property.getName())) {
=======
if (!ChecksumGeneratorOptions.DEFAULT_EXCLUDED_PROPERTIES.contains(property.getName())) {
>>>>>>>
if (!ChecksumGeneratorOptions.DEFAULT_EXCLUDED_PROPERTIES.contains(property.getName())) { |
<<<<<<<
this.commonPosterUsage(exitCode, POSTER_NAME_SUBMIT);
=======
this.commonPosterUsage(exitCode);
}
@Override
protected void usageDescription(PrintStream o) {
o.println("Uploads a threat descriptor with the specified values.");
o.println("On repost (with same indicator text/type and app ID), updates changed fields.");
o.println("");
}
@Override
protected void usageDashIDashN(PrintStream o) {
o.println("Required:");
o.println("-i|--indicator {...} The indicator text: hash/URL/etc.");
o.println("-I Take indicator text from standard input, one per line.");
o.println("Exactly one of -i or -I is required.");
o.println("-t|--type {...}");
o.println("");
}
@Override
protected void usageAddRemoveTags(PrintStream o) {
// Nothing extra here
>>>>>>>
this.commonPosterUsage(exitCode);
}
@Override
protected void usageDescription(PrintStream o) {
o.println("Uploads a threat descriptor with the specified values.");
o.println("On repost (with same indicator text/type and app ID), updates changed fields.");
o.println("");
}
@Override
protected void usageDashIDashN(PrintStream o) {
o.println("Required:");
o.println("-i|--indicator {...} The indicator text: hash/URL/etc.");
o.println("-I Take indicator text from standard input, one per line.");
o.println("Exactly one of -i or -I is required.");
o.println("-t|--type {...}");
o.println("");
}
@Override
protected void usageAddRemoveTags(PrintStream o) {
// Nothing extra here
<<<<<<<
if (args.size() < 1) {
usage(1);
}
=======
>>>>>>> |
<<<<<<<
private final String preparedStatementPreparationUrl;
=======
private final String batchUrl;
>>>>>>>
private final String batchUrl;
private final String preparedStatementPreparationUrl;
<<<<<<<
this.preparedStatementPreparationUrl = "http://" + host + ":" + port + "/prepared-statement-preparation";
=======
this.batchUrl = "http://" + host + ":" + port + "/batch-execution";
>>>>>>>
this.batchUrl = "http://" + host + ":" + port + "/batch-execution";
this.preparedStatementPreparationUrl = "http://" + host + ":" + port + "/prepared-statement-preparation";
<<<<<<<
clearPreparedStatementPreparations();
=======
clearBatchExecutions();
>>>>>>>
clearBatchExecutions();
clearPreparedStatementPreparations(); |
<<<<<<<
public T ADD_ROW() {
sql().values.add(new ArrayList<>());
return getSelf();
}
=======
/**
* Set the limit variable string(e.g. {@code "#{limit}"}).
*
* @param variable a limit variable string
* @return a self instance
* @since 3.5.2
*/
public T LIMIT(String variable) {
sql().limit = variable;
return getSelf();
}
/**
* Set the limit value.
*
* @param value an offset value
* @return a self instance
* @since 3.5.2
*/
public T LIMIT(int value) {
sql().limit = String.valueOf(value);
return getSelf();
}
/**
* Set the offset variable string(e.g. {@code "#{offset}"}).
*
* @param variable a offset variable string
* @return a self instance
* @since 3.5.2
*/
public T OFFSET(String variable) {
sql().offset = variable;
return getSelf();
}
/**
* Set the offset value.
*
* @param value an offset value
* @return a self instance
* @since 3.5.2
*/
public T OFFSET(long value) {
sql().offset = String.valueOf(value);
return getSelf();
}
>>>>>>>
/**
* Set the limit variable string(e.g. {@code "#{limit}"}).
*
* @param variable a limit variable string
* @return a self instance
* @since 3.5.2
*/
public T LIMIT(String variable) {
sql().limit = variable;
return getSelf();
}
/**
* Set the limit value.
*
* @param value an offset value
* @return a self instance
* @since 3.5.2
*/
public T LIMIT(int value) {
sql().limit = String.valueOf(value);
return getSelf();
}
/**
* Set the offset variable string(e.g. {@code "#{offset}"}).
*
* @param variable a offset variable string
* @return a self instance
* @since 3.5.2
*/
public T OFFSET(String variable) {
sql().offset = variable;
return getSelf();
}
/**
* Set the offset value.
*
* @param value an offset value
* @return a self instance
* @since 3.5.2
*/
public T OFFSET(long value) {
sql().offset = String.valueOf(value);
return getSelf();
}
public T ADD_ROW() {
sql().values.add(new ArrayList<>());
return getSelf();
}
<<<<<<<
List<String> sets = new ArrayList<String>();
List<String> select = new ArrayList<String>();
List<String> tables = new ArrayList<String>();
List<String> join = new ArrayList<String>();
List<String> innerJoin = new ArrayList<String>();
List<String> outerJoin = new ArrayList<String>();
List<String> leftOuterJoin = new ArrayList<String>();
List<String> rightOuterJoin = new ArrayList<String>();
List<String> where = new ArrayList<String>();
List<String> having = new ArrayList<String>();
List<String> groupBy = new ArrayList<String>();
List<String> orderBy = new ArrayList<String>();
List<String> lastList = new ArrayList<String>();
List<String> columns = new ArrayList<String>();
List<List<String>> values = new ArrayList<>();
=======
List<String> sets = new ArrayList<>();
List<String> select = new ArrayList<>();
List<String> tables = new ArrayList<>();
List<String> join = new ArrayList<>();
List<String> innerJoin = new ArrayList<>();
List<String> outerJoin = new ArrayList<>();
List<String> leftOuterJoin = new ArrayList<>();
List<String> rightOuterJoin = new ArrayList<>();
List<String> where = new ArrayList<>();
List<String> having = new ArrayList<>();
List<String> groupBy = new ArrayList<>();
List<String> orderBy = new ArrayList<>();
List<String> lastList = new ArrayList<>();
List<String> columns = new ArrayList<>();
List<String> values = new ArrayList<>();
>>>>>>>
List<String> sets = new ArrayList<>();
List<String> select = new ArrayList<>();
List<String> tables = new ArrayList<>();
List<String> join = new ArrayList<>();
List<String> innerJoin = new ArrayList<>();
List<String> outerJoin = new ArrayList<>();
List<String> leftOuterJoin = new ArrayList<>();
List<String> rightOuterJoin = new ArrayList<>();
List<String> where = new ArrayList<>();
List<String> having = new ArrayList<>();
List<String> groupBy = new ArrayList<>();
List<String> orderBy = new ArrayList<>();
List<String> lastList = new ArrayList<>();
List<String> columns = new ArrayList<>();
List<List<String>> values = new ArrayList<>(); |
<<<<<<<
protected String id;
=======
/** The {@link com.effektif.workflow.api.workflow.Activity#id} for the activity this transition leaves from. */
>>>>>>>
protected String id;
/** The {@link com.effektif.workflow.api.workflow.Activity#id} for the activity this transition leaves from. */ |
<<<<<<<
import org.junit.Ignore;
import org.junit.Test;
import com.effektif.mongo.MongoConfiguration;
=======
>>>>>>>
import org.junit.Ignore;
import org.junit.Test;
import com.effektif.mongo.MongoConfiguration;
<<<<<<<
MongoConfiguration configuration = new MongoMemoryConfiguration()
.ingredient(new TestOutgoingEmailService())
=======
return new MongoMemoryConfiguration()
>>>>>>>
MongoConfiguration configuration = new MongoMemoryConfiguration() |
<<<<<<<
private float growfactorIndicator;
public void setGrowFactorIndicator(float growfactorIndicator) {
this.growfactorIndicator = growfactorIndicator;
}
public float getGrowFactorIndicator() {
return growfactorIndicator;
}
=======
VelocityTracker velocityTracker = null;
private int maximumVelocity;
private float SNAP_VELOCITY_DIP_PER_SECOND = 400;
private int densityAdjustedSnapVelocity;
private boolean isSmoothScrolling;
private CompactCalendarView.CompactCalendarViewListener listener;
private boolean isScrolling;
private int distanceThresholdForAutoScroll;
private long lastAutoScrollFromFling;
>>>>>>>
private float growfactorIndicator;
VelocityTracker velocityTracker = null;
private int maximumVelocity;
private float SNAP_VELOCITY_DIP_PER_SECOND = 400;
private int densityAdjustedSnapVelocity;
private boolean isSmoothScrolling;
private CompactCalendarView.CompactCalendarViewListener listener;
private boolean isScrolling;
private int distanceThresholdForAutoScroll;
private long lastAutoScrollFromFling;
public void setGrowFactorIndicator(float growfactorIndicator) {
this.growfactorIndicator = growfactorIndicator;
}
public float getGrowFactorIndicator() {
return growfactorIndicator;
}
<<<<<<<
public void setGrowGfactor(float grow) {
growFactor = grow;
}
public float getGrowFactor() {
return growFactor;
}
public void setAnimation(boolean shouldAnimate){
isAnimating = shouldAnimate;
}
Date onSingleTapConfirmed(MotionEvent e) {
monthsScrolledSoFar = Math.round(accumulatedScrollOffset.x / width);
int dayColumn = Math.round((paddingLeft + e.getX() - paddingWidth - paddingRight) / widthPerDay);
int dayRow = Math.round((e.getY() - paddingHeight) / heightPerDay);
setCalenderToFirstDayOfMonth(calendarWithFirstDayOfMonth, currentDate, -monthsScrolledSoFar, 0);
//Start Monday as day 1 and Sunday as day 7. Not Sunday as day 1 and Monday as day 2
int firstDayOfMonth = getDayOfWeek(calendarWithFirstDayOfMonth);
int dayOfMonth = ((dayRow - 1) * 7 + dayColumn + 1) - firstDayOfMonth;
if (dayOfMonth < calendarWithFirstDayOfMonth.getActualMaximum(Calendar.DAY_OF_MONTH)
&& dayOfMonth >= 0) {
calendarWithFirstDayOfMonth.add(Calendar.DATE, dayOfMonth);
currentCalender.setTimeInMillis(calendarWithFirstDayOfMonth.getTimeInMillis());
return currentCalender.getTime();
} else {
return null;
}
}
boolean onDown(MotionEvent e) {
scroller.forceFinished(true);
return true;
}
boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) {
scroller.forceFinished(true);
return true;
}
boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY) {
if (currentDirection == Direction.NONE) {
if (Math.abs(distanceX) > Math.abs(distanceY)) {
currentDirection = Direction.HORIZONTAL;
} else {
currentDirection = Direction.VERTICAL;
}
}
this.distanceX = distanceX;
return true;
}
=======
>>>>>>>
public void setGrowGfactor(float grow) {
growFactor = grow;
}
public float getGrowFactor() {
return growFactor;
}
public void setAnimation(boolean shouldAnimate){
isAnimating = shouldAnimate;
}
boolean onDown(MotionEvent e) {
scroller.forceFinished(true);
return true;
}
boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) {
scroller.forceFinished(true);
return true;
} |
<<<<<<<
@Nonnull private HashMap<String, ClassDef> availableClasses = Maps.newHashMap();
=======
@Nonnull private int api;
>>>>>>>
@Nonnull private HashMap<String, ClassDef> availableClasses = Maps.newHashMap();
@Nonnull private int api; |
<<<<<<<
=======
@Override
>>>>>>>
@Override
<<<<<<<
boolean hasChildren = value.hasChildren( typeName );
if ( hasChildren == false && type.cardinality().min() > 0 && !(type instanceof TypePair) ) {
=======
final boolean hasChildren = value.hasChildren( typeName );
if ( hasChildren == false && type.cardinality().min() > 0 ) {
>>>>>>>
final boolean hasChildren = value.hasChildren( typeName );
if ( hasChildren == false && type.cardinality().min() > 0 ) {
<<<<<<<
ValueVector vector = value.getChildren( typeName );
int size = vector.size();
if (!(type instanceof TypePair ) && checkCardinality(type, size)) {
=======
final ValueVector vector = value.getChildren( typeName );
final int size = vector.size();
if ( type.cardinality().min() > size || type.cardinality().max() < size ) {
>>>>>>>
final ValueVector vector = value.getChildren( typeName );
final int size = vector.size();
if ( type.cardinality().min() > size || type.cardinality().max() < size ) {
<<<<<<<
=======
@Override
>>>>>>>
@Override |
<<<<<<<
import eu.mihosoft.vrl.workflow.skin.ConnectionSkin;
=======
import eu.mihosoft.vrl.workflow.VisualizationRequest;
import java.util.Optional;
>>>>>>>
import eu.mihosoft.vrl.workflow.VisualizationRequest;
import eu.mihosoft.vrl.workflow.skin.ConnectionSkin;
import java.util.Optional;
<<<<<<<
if (connResult.getStatus().isCompatible()) {
String action = "handle"; // TODO: implement
=======
getReceiverUI().toFront();
connectionPath.toBack();
getReceiverUI().layoutXProperty().bind(receiveXBinding);
getReceiverUI().layoutYProperty().bind(receiveYBinding);
SelectedConnector selConnector
= FXConnectorUtil.getSelectedInputConnector(
getSender().getNode(), getParent(), type, t);
boolean isSameConnection = false;
if (selConnector != null
&& selConnector.getNode() != null
&& selConnector.getConnector() != null) {
Node n = selConnector.getNode();
n.toFront();
Connector receiverConnector = selConnector.getConnector();
isSameConnection = receiverConnector.equals(getReceiver());
if (!isSameConnection) {
ConnectionResult connResult = controller.connect(
getSender(), receiverConnector);
if (connResult.getStatus().isCompatible()) {
connectionListener.onCreateNewConnectionReleased(connResult);
}
if (connResult.getStatus().isCompatible()) {
//
} else {
connectionListener.onConnectionIncompatibleReleased(n);
}
}
>>>>>>>
getReceiverUI().toFront();
connectionPath.toBack();
getReceiverUI().layoutXProperty().bind(receiveXBinding);
getReceiverUI().layoutYProperty().bind(receiveYBinding);
SelectedConnector selConnector
= FXConnectorUtil.getSelectedInputConnector(
getSender().getNode(), getParent(), type, t);
boolean isSameConnection = false;
if (selConnector != null
&& selConnector.getNode() != null
&& selConnector.getConnector() != null) {
Node n = selConnector.getNode();
n.toFront();
Connector receiverConnector = selConnector.getConnector();
isSameConnection = receiverConnector.equals(getReceiver());
if (!isSameConnection) {
ConnectionResult connResult = controller.connect(
getSender(), receiverConnector);
if (connResult.getStatus().isCompatible()) {
connectionListener.onCreateNewConnectionReleased(connResult);
}
if (connResult.getStatus().isCompatible()) {
//
} else {
connectionListener.onConnectionIncompatibleReleased(n);
}
}
<<<<<<<
} else {
String action = "handle"; // TODO: implement
}
=======
if (!isSameConnection) {
>>>>>>>
if (!isSameConnection) { |
<<<<<<<
=======
import hudson.plugins.jira.soap.RemoteComment;
import hudson.plugins.jira.soap.RemoteGroup;
import hudson.plugins.jira.soap.RemoteIssue;
import hudson.plugins.jira.soap.RemotePermissionException;
>>>>>>>
<<<<<<<
=======
import javax.xml.rpc.ServiceException;
import java.io.IOException;
import java.rmi.RemoteException;
>>>>>>>
import java.rmi.RemoteException; |
<<<<<<<
import org.joda.time.DateTime;
import org.kohsuke.stapler.DataBoundConstructor;
import org.kohsuke.stapler.QueryParameter;
=======
import hudson.util.Secret;
>>>>>>>
import hudson.util.Secret;
import org.joda.time.DateTime;
import org.kohsuke.stapler.DataBoundConstructor;
import org.kohsuke.stapler.QueryParameter; |
<<<<<<<
private static final String JIRA_PRJ = "TEST_PRJ";
=======
private static final String JIRA_VER_PARAM = "${JIRA_VER}";
private static final String JIRA_PRJ = "TEST_PRJ";
>>>>>>>
private static final String JIRA_PRJ = "TEST_PRJ";
private static final String JIRA_VER_PARAM = "${JIRA_VER}"; |
<<<<<<<
import org.springframework.messaging.Message;
import org.springframework.messaging.PollableChannel;
import org.springframework.messaging.support.GenericMessage;
=======
import org.springframework.integration.message.GenericMessage;
import org.springframework.integration.sftp.session.SftpFileInfo;
import org.springframework.integration.test.util.TestUtils;
>>>>>>>
import org.springframework.integration.test.util.TestUtils;
import org.springframework.messaging.Message;
import org.springframework.messaging.PollableChannel;
import org.springframework.messaging.support.GenericMessage; |
<<<<<<<
import org.springframework.messaging.Message;
=======
import org.springframework.integration.metadata.PropertiesPersistingMetadataStore;
import org.springframework.integration.test.util.TestUtils;
>>>>>>>
import org.springframework.integration.metadata.PropertiesPersistingMetadataStore;
import org.springframework.integration.test.util.TestUtils;
import org.springframework.messaging.Message; |
<<<<<<<
=======
import org.springframework.data.redis.listener.RedisMessageListenerContainer;
import org.springframework.integration.Message;
import org.springframework.integration.MessageChannel;
>>>>>>>
import org.springframework.data.redis.listener.RedisMessageListenerContainer; |
<<<<<<<
//根据姓名首拼模糊查找,并分页
Page<User> findByPinyinLike(String pinyin,Pageable pa);
//根据姓名首拼+查找关键字查找(部门、姓名、电话号码),并分页
@Query("from User u where (u.userName like ?1 or u.dept.deptName like ?1 or u.userTel like ?1 or u.position.name like ?1) and u.pinyin like ?2")
Page<User> findSelectUsers(String baseKey,String pinyinm,Pageable pa);
//根据姓名首拼+查找关键字查找(部门、姓名、电话号码),并分页
@Query("from User u where u.userName like ?1 or u.dept.deptName like ?1 or u.userTel like ?1 or u.position.name like ?1 or u.pinyin like ?2")
Page<User> findUsers(String baseKey,String baseKey2,Pageable pa);
=======
/**
* 用户管理查询可用用户
* @param isLock
* @param pa
* @return
*/
Page<User> findByIsLock(Integer isLock,Pageable pa);
@Query("from User u where u.dept.deptName like %?1% or u.userName like %?1% or u.realName like %?1% or u.userTel like %?1% or u.role.roleName like %?1%")
Page<User> findnamelike(String name,Pageable pa);
List<User> findByDept(Dept dept);
>>>>>>>
//根据姓名首拼模糊查找,并分页
Page<User> findByPinyinLike(String pinyin,Pageable pa);
//根据姓名首拼+查找关键字查找(部门、姓名、电话号码),并分页
@Query("from User u where (u.userName like ?1 or u.dept.deptName like ?1 or u.userTel like ?1 or u.position.name like ?1) and u.pinyin like ?2")
Page<User> findSelectUsers(String baseKey,String pinyinm,Pageable pa);
//根据姓名首拼+查找关键字查找(部门、姓名、电话号码),并分页
@Query("from User u where u.userName like ?1 or u.dept.deptName like ?1 or u.userTel like ?1 or u.position.name like ?1 or u.pinyin like ?2")
Page<User> findUsers(String baseKey,String baseKey2,Pageable pa);
/**
* 用户管理查询可用用户
* @param isLock
* @param pa
* @return
*/
Page<User> findByIsLock(Integer isLock,Pageable pa);
@Query("from User u where u.dept.deptName like %?1% or u.userName like %?1% or u.realName like %?1% or u.userTel like %?1% or u.role.roleName like %?1%")
Page<User> findnamelike(String name,Pageable pa);
List<User> findByDept(Dept dept); |
<<<<<<<
=======
import org.springframework.integration.MessageChannel;
import org.springframework.integration.context.IntegrationProperties;
>>>>>>>
import org.springframework.integration.context.IntegrationProperties; |
<<<<<<<
import org.springframework.messaging.MessageHeaders;
=======
import org.springframework.integration.MessageHeaders;
import org.springframework.integration.json.JsonHeaders;
>>>>>>>
import org.springframework.integration.json.JsonHeaders;
import org.springframework.messaging.MessageHeaders; |
<<<<<<<
=======
import org.springframework.expression.spel.standard.SpelExpressionParser;
import org.springframework.integration.Message;
>>>>>>>
import org.springframework.expression.spel.standard.SpelExpressionParser;
<<<<<<<
=======
import org.springframework.integration.core.PollableChannel;
import org.springframework.integration.file.remote.InputStreamCallback;
import org.springframework.integration.file.remote.RemoteFileTemplate;
>>>>>>>
import org.springframework.integration.file.remote.InputStreamCallback;
import org.springframework.integration.file.remote.RemoteFileTemplate; |
<<<<<<<
e.printStackTrace();
Log.log(e);
=======
PydevPlugin.log(e);
>>>>>>>
Log.log(e); |
<<<<<<<
import org.python.pydev.shared_core.string.StringUtils;
=======
import org.python.pydev.shared_core.SharedCorePlugin;
>>>>>>>
import org.python.pydev.shared_core.SharedCorePlugin;
import org.python.pydev.shared_core.string.StringUtils; |
<<<<<<<
import java.io.ByteArrayInputStream;
import java.util.Set;
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.text.IDocument;
import org.python.pydev.core.FileUtilsFileBuffer;
import org.python.pydev.core.docutils.SyntaxErrorException;
import org.python.pydev.core.log.Log;
import org.python.pydev.editor.actions.PyAction;
=======
>>>>>>>
<<<<<<<
import org.python.pydev.shared_ui.utils.RunInUiThread;
=======
>>>>>>> |
<<<<<<<
public void build(IBuildConfiguration[] buildConfigs, int kind, boolean buildReferences, IProgressMonitor monitor) throws CoreException {
}
public IBuildConfiguration newBuildConfig(String projectName, String configName) {
return null;
}
=======
>>>>>>>
public void build(IBuildConfiguration[] buildConfigs, int kind, boolean buildReferences, IProgressMonitor monitor) throws CoreException {
} |
<<<<<<<
=======
PySelection base = edit.createPySelection();
if(!(this.edit instanceof PyEdit) || base == null){
return new ICompletionProposal[0];
}
PyEdit editor = (PyEdit) this.edit;
List<ICompletionProposal> results = new ArrayList<ICompletionProposal>();
String sel = PyAction.getLineWithoutComments(base);
List<IAssistProps> assists = new ArrayList<IAssistProps>();
synchronized (PythonCorrectionProcessor.additionalAssists) {
for (IAssistProps prop : additionalAssists.values()) {
assists.add(prop);
}
}
assists.add(new AssistSurroundWith());
assists.add(new AssistImport());
assists.add(new AssistDocString());
assists.add(new AssistAssign());
assists.add(new AssistPercentToFormat());
// assists.add(new AssistOverride()); -- Not ready!
assists.addAll(ExtensionHelper.getParticipants(ExtensionHelper.PYDEV_CTRL_1));
ImageCache imageCache = PydevPlugin.getImageCache();
File editorFile = edit.getEditorFile();
IPythonNature pythonNature = null;
try {
pythonNature = edit.getPythonNature();
} catch (MisconfigurationException e1) {
Log.log(e1);
}
for (IAssistProps assist : assists) {
//Always create a new for each assist, as any given assist may change it.
PySelection ps = new PySelection(base);
try {
if (assist.isValid(ps, sel, editor, offset)) {
try {
results.addAll(assist.getProps(
ps,
imageCache,
editorFile,
pythonNature,
editor,
offset)
);
} catch (Exception e) {
Log.log(e);
}
}
} catch (Exception e) {
Log.log(e);
}
}
Collections.sort(results, IPyCodeCompletion.PROPOSAL_COMPARATOR);
try{
//handling spelling... (we only want to show spelling fixes if a spell problem annotation is found at the current location).
//we'll only show some spelling proposal if there's some spelling problem (so, we don't have to check the preferences at this place,
//as no annotations on spelling will be here if the spelling is not enabled).
ICompletionProposal[] spellProps = null;
IAnnotationModel annotationModel = editor.getPySourceViewer().getAnnotationModel();
Iterator<Object> it = annotationModel.getAnnotationIterator();
while(it.hasNext()){
Object annotation = it.next();
if(annotation instanceof SpellingAnnotation){
SpellingAnnotation spellingAnnotation = (SpellingAnnotation) annotation;
SpellingProblem spellingProblem = spellingAnnotation.getSpellingProblem();
int problemOffset = spellingProblem.getOffset();
int problemLen = spellingProblem.getLength();
if(problemOffset <= offset && problemOffset+problemLen >= offset){
SpellingCorrectionProcessor spellingCorrectionProcessor = new SpellingCorrectionProcessor();
spellProps = spellingCorrectionProcessor.computeQuickAssistProposals(invocationContext);
break;
}
}
}
if(spellProps == null || (spellProps.length == 1 && spellProps[0] instanceof NoCompletionsProposal)){
//no proposals from the spelling
return (ICompletionProposal[]) results.toArray(new ICompletionProposal[results.size()]);
}
//ok, add the spell problems and return...
ICompletionProposal[] ret = (ICompletionProposal[]) results.toArray(new ICompletionProposal[results.size()+spellProps.length]);
System.arraycopy(spellProps, 0, ret, results.size(), spellProps.length);
return ret;
}catch(Throwable e){
if(e instanceof ClassNotFoundException || e instanceof LinkageError || e instanceof NoSuchMethodException ||
e instanceof NoSuchMethodError || e instanceof NoClassDefFoundError){
//Eclipse 3.2 support
return (ICompletionProposal[]) results.toArray(new ICompletionProposal[results.size()]);
}
throw new RuntimeException(e);
}
}
@SuppressWarnings("unchecked")
private ICompletionProposal[] onComputeQuickAssistProposals(IQuickAssistInvocationContext invocationContext) {
int offset = invocationContext.getOffset();
>>>>>>>
<<<<<<<
=======
assists.add(new AssistPercentToFormat());
// assists.add(new AssistOverride()); -- Not ready!
>>>>>>>
assists.add(new AssistPercentToFormat()); |
<<<<<<<
synchronized (lock) {
Tuple3<String, String, String> cacheKey = new Tuple3<String, String, String>(key, stringToAddToDecoration,
"stringDecoration");
Image image = imageHash.get(cacheKey);
if (image == null) {
Display display = Display.getCurrent();
image = new Image(display, get(key), SWT.IMAGE_COPY);
imageHash.put(cacheKey, image); //put it there (even though it'll still be changed).
int base = 10;
GC gc = new GC(image);
// Color color = new Color(display, 0, 0, 0);
// Color color2 = new Color(display, 255, 255, 255);
// gc.setForeground(color2);
// gc.setBackground(color2);
// gc.setFillRule(SWT.FILL_WINDING);
// gc.fillRoundRectangle(2, 1, base-1, base, 2, 2);
// gc.setForeground(color);
// gc.drawRoundRectangle(6, 0, base, base+1, 2, 2);
// color2.dispose();
// color.dispose();
Color colorBackground = new Color(display, 255, 255, 255);
Color colorForeground = new Color(display, 0, 83, 41);
Font font = new Font(display, new FontData("Courier New", base - 1, SWT.BOLD));
try {
gc.setForeground(colorForeground);
gc.setBackground(colorBackground);
gc.setTextAntialias(SWT.ON);
gc.setFont(font);
gc.drawText(stringToAddToDecoration, 5, 0, true);
} catch (Exception e) {
Log.log(e);
} finally {
colorBackground.dispose();
colorForeground.dispose();
font.dispose();
gc.dispose();
}
}
return image;
}
=======
synchronized(lock){
Tuple3<String, String, String> cacheKey = new Tuple3<String, String, String>(key, stringToAddToDecoration, "stringDecoration");
Image image = imageHash.get(cacheKey);
if(image == null){
Display display = Display.getCurrent();
image = new Image(display, get(key), SWT.IMAGE_COPY);
imageHash.put(cacheKey, image); //put it there (even though it'll still be changed).
Tuple<String, Integer> codeFontDetails = FontUtils.getCodeFontNameAndHeight(IFontUsage.IMAGECACHE);
String fontName = codeFontDetails.o1;
int base = codeFontDetails.o2.intValue();
GC gc = new GC(image);
// Color color = new Color(display, 0, 0, 0);
// Color color2 = new Color(display, 255, 255, 255);
// gc.setForeground(color2);
// gc.setBackground(color2);
// gc.setFillRule(SWT.FILL_WINDING);
// gc.fillRoundRectangle(2, 1, base-1, base, 2, 2);
// gc.setForeground(color);
// gc.drawRoundRectangle(6, 0, base, base+1, 2, 2);
// color2.dispose();
// color.dispose();
Color colorBackground = new Color(display, 255, 255, 255);
Color colorForeground = new Color(display, 0, 83, 41);
FontData labelFontData;
// get TextFont from preferences
FontData[] textFontData = JFaceResources.getTextFont().getFontData();
if (textFontData.length == 1) {
labelFontData = textFontData[0];
} else {
labelFontData = new FontData(fontName, base, SWT.BOLD);
}
Font font = new Font(display, labelFontData);
try {
gc.setForeground(colorForeground);
gc.setBackground(colorBackground);
gc.setTextAntialias(SWT.ON);
gc.setFont(font);
gc.drawText(stringToAddToDecoration, 5, 0, true);
} catch (Exception e) {
Log.log(e);
}finally{
colorBackground.dispose();
colorForeground.dispose();
font.dispose();
gc.dispose();
}
}
return image;
}
>>>>>>>
synchronized (lock) {
Tuple3<String, String, String> cacheKey = new Tuple3<String, String, String>(key, stringToAddToDecoration,
"stringDecoration");
Image image = imageHash.get(cacheKey);
if (image == null) {
Display display = Display.getCurrent();
image = new Image(display, get(key), SWT.IMAGE_COPY);
imageHash.put(cacheKey, image); //put it there (even though it'll still be changed).
Tuple<String, Integer> codeFontDetails = FontUtils.getCodeFontNameAndHeight(IFontUsage.IMAGECACHE);
String fontName = codeFontDetails.o1;
int base = codeFontDetails.o2.intValue();
GC gc = new GC(image);
// Color color = new Color(display, 0, 0, 0);
// Color color2 = new Color(display, 255, 255, 255);
// gc.setForeground(color2);
// gc.setBackground(color2);
// gc.setFillRule(SWT.FILL_WINDING);
// gc.fillRoundRectangle(2, 1, base-1, base, 2, 2);
// gc.setForeground(color);
// gc.drawRoundRectangle(6, 0, base, base+1, 2, 2);
// color2.dispose();
// color.dispose();
Color colorBackground = new Color(display, 255, 255, 255);
Color colorForeground = new Color(display, 0, 83, 41);
FontData labelFontData;
// get TextFont from preferences
FontData[] textFontData = JFaceResources.getTextFont().getFontData();
if (textFontData.length == 1) {
labelFontData = textFontData[0];
} else {
labelFontData = new FontData(fontName, base, SWT.BOLD);
}
Font font = new Font(display, labelFontData);
try {
gc.setForeground(colorForeground);
gc.setBackground(colorBackground);
gc.setTextAntialias(SWT.ON);
gc.setFont(font);
gc.drawText(stringToAddToDecoration, 5, 0, true);
} catch (Exception e) {
Log.log(e);
} finally {
colorBackground.dispose();
colorForeground.dispose();
font.dispose();
gc.dispose();
}
}
return image;
} |
<<<<<<<
assertTrue(imapMessages.length == 2);
assertTrue(imapMessages[0] == m0);
=======
assertEquals(1, imapMessages.length);
assertEquals(m0, imapMessages[0]);
>>>>>>>
assertTrue(imapMessages.length == 2);
assertTrue(imapMessages[0] == m0);
<<<<<<<
assertTrue(imapMessages.length == 2);
assertTrue(imapMessages[0] == m0);
=======
assertEquals(1, imapMessages.length);
assertEquals(m0, imapMessages[0]);
>>>>>>>
assertTrue(imapMessages.length == 2);
assertTrue(imapMessages[0] == m0);
<<<<<<<
assertTrue(imapMessages.length == 2);
assertTrue(imapMessages[0] == m0);
=======
assertEquals(1, imapMessages.length);
assertEquals(m0, imapMessages[0]);
>>>>>>>
assertTrue(imapMessages.length == 2);
assertTrue(imapMessages[0] == m0);
<<<<<<<
assertTrue(imapMessages.length == 2);
//Search OrTerm - Search Subject which contains String1 OR String2
imapMessages = imapFolder.search(new OrTerm(new SubjectTerm("test0Search"),new SubjectTerm("String2")));
assertTrue(imapMessages.length == 2);
assertTrue(imapMessages[0] == m0);
//Search AndTerm - Search Subject which contains String1 AND String2
imapMessages = imapFolder.search(new AndTerm(new SubjectTerm("test0Search"),new SubjectTerm("test1Search")));
assertTrue(imapMessages.length == 1);
assertTrue(imapMessages[0] == m1);
=======
assertEquals(2, imapMessages.length);
// Content
final String pattern = "\u00e4\u03A0";
imapMessages = imapFolder.search(new SubjectTerm(pattern));
assertEquals(1, imapMessages.length);
assertTrue(imapMessages[0].getSubject().contains(pattern));
>>>>>>>
assertTrue(imapMessages.length == 2);
//Search OrTerm - Search Subject which contains String1 OR String2
imapMessages = imapFolder.search(new OrTerm(new SubjectTerm("test0Search"),new SubjectTerm("String2")));
assertTrue(imapMessages.length == 2);
assertTrue(imapMessages[0] == m0);
//Search AndTerm - Search Subject which contains String1 AND String2
imapMessages = imapFolder.search(new AndTerm(new SubjectTerm("test0Search"),new SubjectTerm("test1Search")));
assertTrue(imapMessages.length == 1);
assertTrue(imapMessages[0] == m1);
// Content
final String pattern = "\u00e4\u03A0";
imapMessages = imapFolder.search(new SubjectTerm(pattern));
assertEquals(1, imapMessages.length);
assertTrue(imapMessages[0].getSubject().contains(pattern));
<<<<<<<
message2.setSubject("test0Search test1Search");
message2.setText("content");
=======
message2.setSubject("test1Search \u00c4\u00e4\u03A0", "UTF-8");
message2.setText("content \u00c4\u00e4\u03A0", "UTF-8");
>>>>>>>
message2.setSubject("test0Search test1Search \u00c4\u00e4\u03A0", "UTF-8");
message2.setText("content \u00c4\u00e4\u03A0", "UTF-8"); |
<<<<<<<
private static final Logger LOG = Logger.getLogger(QuiescentRegistryListener.class);
private final Timer quiescentTimer = new Timer(getClass().getSimpleName(), true);
=======
private final Scheduler quiescentScheduler;
>>>>>>>
private static final Logger LOG = Logger.getLogger(QuiescentRegistryListener.class);
private final Timer quiescentTimer = new Timer(getClass().getSimpleName(), true);
private final Scheduler quiescentScheduler;
<<<<<<<
private final Object lock = new Object();
=======
private final Supplier<Long> clock;
>>>>>>>
private final Object lock = new Object();
private final Supplier<Long> clock;
<<<<<<<
synchronized (lock) {
if (lastTimeMonitorableAdded > 0 && System.currentTimeMillis() > (lastTimeMonitorableAdded + quietPeriodInMillis)) {
LOG.info(String.format("New Monitorables detected after quiet period of %dms", quietPeriodInMillis));
runnable.run();
lastTimeMonitorableAdded = 0;
}
=======
if (lastTimeMonitorableAdded > 0 && clock.get().longValue() >= (lastTimeMonitorableAdded + quietPeriodInMillis)) {
runnable.run();
lastTimeMonitorableAdded = 0;
>>>>>>>
synchronized (lock) {
if (lastTimeMonitorableAdded > 0 && clock.get().longValue() >= (lastTimeMonitorableAdded + quietPeriodInMillis)) {
LOG.info(String.format("New Monitorables detected after quiet period of %dms", quietPeriodInMillis));
runnable.run();
lastTimeMonitorableAdded = 0;
} |
<<<<<<<
=======
final long unlockTime = TimeService.currentTimeSeconds() + seconds;
>>>>>>> |
<<<<<<<
import io.nuls.network.netty.task.SaveNodeInfoTask;
=======
import io.nuls.network.netty.task.ShareMineNodeTask;
>>>>>>>
import io.nuls.network.netty.task.ShareMineNodeTask;
import io.nuls.network.netty.task.SaveNodeInfoTask;
<<<<<<<
executorService.scheduleAtFixedRate(new SaveNodeInfoTask(), 10000L, 10000L, TimeUnit.MILLISECONDS);
=======
TaskManager.createAndRunThread(ProtocolConstant.MODULE_ID_PROTOCOL, "share-mine-node", new ShareMineNodeTask());
>>>>>>>
executorService.scheduleAtFixedRate(new SaveNodeInfoTask(), 10000L, 10000L, TimeUnit.MILLISECONDS);
TaskManager.createAndRunThread(ProtocolConstant.MODULE_ID_PROTOCOL, "share-mine-node", new ShareMineNodeTask()); |
<<<<<<<
import org.junit.Ignore;
=======
import org.cloudfoundry.identity.uaa.test.TestUtils;
import org.cloudfoundry.identity.uaa.user.UaaAuthority;
>>>>>>>
import org.cloudfoundry.identity.uaa.test.TestUtils;
import org.junit.Ignore;
<<<<<<<
.update("insert into users (id, active, email, crypted_password, created_at, updated_at) values (?, ?, ?, ?, ?, ?)",
4, true, "invalid", "ENCRYPT_ME", new Date(), new Date());
=======
.update("insert into users (id, active, email, crypted_password, created_at, updated_at) values (?, ?, ?, ?, ?, ?)",
4, true, "invalid", "ENCRYPT_ME", new Date(), new Date());
new JdbcTemplate(cloudControllerDataSource)
.update("insert into users (id, active, email, crypted_password, created_at, updated_at) values (?, ?, ?, ?, ?, ?)",
4, true, "[email protected]", "ENCRYPT_ME", new Date(), new Date());
>>>>>>>
.update("insert into users (id, active, email, crypted_password, created_at, updated_at) values (?, ?, ?, ?, ?, ?)",
4, true, "invalid", "ENCRYPT_ME", new Date(), new Date());
new JdbcTemplate(cloudControllerDataSource)
.update("insert into users (id, active, email, crypted_password, created_at, updated_at) values (?, ?, ?, ?, ?, ?)",
4, true, "[email protected]", "ENCRYPT_ME", new Date(), new Date());
<<<<<<<
assertEquals(3, jdbcTemplate.queryForInt("select count(*) from users"));
assertEquals(2,
jdbcTemplate.queryForInt("select count(*) from users where authorities=?", "uaa.admin,uaa.user"));
=======
assertEquals(1, jdbcTemplate.queryForInt("select count(*) from users"));
assertEquals(1,
jdbcTemplate.queryForInt("select count(*) from users where authority=?", UaaAuthority.ROLE_ADMIN.value()));
>>>>>>>
assertEquals(1, jdbcTemplate.queryForInt("select count(*) from users"));
assertEquals(1,
jdbcTemplate.queryForInt("select count(*) from users where authorities=?", "uaa.admin,uaa.user")); |
<<<<<<<
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Set;
=======
>>>>>>>
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Set;
<<<<<<<
//update the user itself
ScimUser user = getScimUser(event.getUser());
updateUser(user, event.getUser(), false);
} else if (event instanceof InvitedUserAuthenticatedEvent) {
ScimUser scimUser = getScimUser(event.getUser());
updateUser(scimUser, event.getUser(), true);
=======
if(event.isUserUpdated()) {
//update the user itself
ScimUser user = getScimUser(event.getUser());
updateUser(user, event.getUser(), false);
}
>>>>>>>
//update the user itself
if(event.isUserUpdated()) {
//update the user itself
ScimUser user = getScimUser(event.getUser());
updateUser(user, event.getUser(), false);
}
} else if (event instanceof InvitedUserAuthenticatedEvent) {
ScimUser scimUser = getScimUser(event.getUser());
updateUser(scimUser, event.getUser(), true); |
<<<<<<<
private XOIDCIdentityProviderDefinition config;
private Signer signer;
private String rsaSigningKey;
=======
private boolean addShadowUserOnLogin;
>>>>>>>
private XOIDCIdentityProviderDefinition config;
private Signer signer;
private String rsaSigningKey;
private boolean addShadowUserOnLogin;
<<<<<<<
config = new XOIDCIdentityProviderDefinition()
.setAuthUrl(new URL("http://oidc10.identity.cf-app.com/oauth/authorize"))
.setTokenUrl(new URL("http://oidc10.identity.cf-app.com/oauth/token"))
.setTokenKeyUrl(new URL("http://oidc10.identity.cf-app.com/token_key"))
.setShowLinkText(true)
.setLinkText("My OIDC Provider")
.setRelyingPartyId("identity")
.setRelyingPartySecret("identitysecret")
.setUserInfoUrl(new URL("http://oidc10.identity.cf-app.com/userinfo"))
.setTokenKey("-----BEGIN PUBLIC KEY-----\n" +
"MFswDQYJKoZIhvcNAQEBBQADSgAwRwJAcjAgsHEfrUxeTFwQPb17AkZ2Im4SfZdp\n" +
"Y8Ada9pZfxXz1PZSqv9TPTMAzNx+EkzMk2IMYN+uNm1bfDzaxVdz+QIDAQAB\n" +
"-----END PUBLIC KEY-----");
=======
addShadowUserOnLogin = true;
>>>>>>>
addShadowUserOnLogin = true;
config = new XOIDCIdentityProviderDefinition()
.setAuthUrl(new URL("http://oidc10.identity.cf-app.com/oauth/authorize"))
.setTokenUrl(new URL("http://oidc10.identity.cf-app.com/oauth/token"))
.setTokenKeyUrl(new URL("http://oidc10.identity.cf-app.com/token_key"))
.setShowLinkText(true)
.setLinkText("My OIDC Provider")
.setRelyingPartyId("identity")
.setRelyingPartySecret("identitysecret")
.setUserInfoUrl(new URL("http://oidc10.identity.cf-app.com/userinfo"))
.setTokenKey("-----BEGIN PUBLIC KEY-----\n" +
"MFswDQYJKoZIhvcNAQEBBQADSgAwRwJAcjAgsHEfrUxeTFwQPb17AkZ2Im4SfZdp\n" +
"Y8Ada9pZfxXz1PZSqv9TPTMAzNx+EkzMk2IMYN+uNm1bfDzaxVdz+QIDAQAB\n" +
"-----END PUBLIC KEY-----");
<<<<<<<
=======
XOIDCIdentityProviderDefinition config = new XOIDCIdentityProviderDefinition()
.setAuthUrl(new URL("http://oidc10.identity.cf-app.com/oauth/authorize"))
.setTokenUrl(new URL("http://oidc10.identity.cf-app.com/oauth/token"))
.setTokenKeyUrl(new URL("http://oidc10.identity.cf-app.com/token_key"))
.setShowLinkText(true)
.setLinkText("My OIDC Provider")
.setRelyingPartyId("identity")
.setRelyingPartySecret("identitysecret")
.setUserInfoUrl(new URL("http://oidc10.identity.cf-app.com/userinfo"))
.setAddShadowUserOnLogin(addShadowUserOnLogin)
.setTokenKey("secret");
>>>>>>> |
<<<<<<<
import org.cloudfoundry.identity.uaa.zone.ClientServicesExtension;
import org.cloudfoundry.identity.uaa.zone.IdentityZoneHolder;
=======
import org.cloudfoundry.identity.uaa.zone.*;
import org.junit.After;
>>>>>>>
import org.cloudfoundry.identity.uaa.zone.*;
import org.junit.After;
import org.cloudfoundry.identity.uaa.zone.IdentityZoneHolder; |
<<<<<<<
public void test_multiple_keys() throws InvalidIdentityZoneDetailsException {
bootstrap.setSamlSpPrivateKey(SamlTestUtils.PROVIDER_PRIVATE_KEY);
bootstrap.setSamlSpCertificate(SamlTestUtils.PROVIDER_CERTIFICATE);
bootstrap.setSamlSpPrivateKeyPassphrase(SamlTestUtils.PROVIDER_PRIVATE_KEY_PASSWORD);
Map<String, Map<String, String>> keys = new HashMap<>();
Map<String, String> key1 = new HashMap<>();
key1.put("key", SamlTestUtils.PROVIDER_PRIVATE_KEY);
key1.put("passphrase", SamlTestUtils.PROVIDER_PRIVATE_KEY_PASSWORD);
key1.put("certificate", SamlTestUtils.PROVIDER_CERTIFICATE);
keys.put("key1", key1);
bootstrap.setActiveKeyId("key1");
bootstrap.setSamlKeys(keys);
bootstrap.afterPropertiesSet();
IdentityZone uaa = provisioning.retrieve(IdentityZone.getUaa().getId());
SamlConfig config = uaa.getConfig().getSamlConfig();
assertEquals(SamlTestUtils.PROVIDER_PRIVATE_KEY, config.getPrivateKey());
assertEquals(SamlTestUtils.PROVIDER_PRIVATE_KEY_PASSWORD, config.getPrivateKeyPassword());
assertEquals(SamlTestUtils.PROVIDER_CERTIFICATE, config.getCertificate());
assertEquals("key1", config.getActiveKeyId());
assertEquals(2, config.getKeys().size());
assertEquals(SamlTestUtils.PROVIDER_PRIVATE_KEY, config.getKeys().get("key1").getKey());
assertEquals(SamlTestUtils.PROVIDER_PRIVATE_KEY_PASSWORD, config.getKeys().get("key1").getPassphrase());
assertEquals(SamlTestUtils.PROVIDER_CERTIFICATE, config.getKeys().get("key1").getCertificate());
}
@Test
=======
public void testClientSecretPolicy() throws Exception {
bootstrap.setClientSecretPolicy(new ClientSecretPolicy(0, 255, 0, 1, 1, 1, 6));
bootstrap.afterPropertiesSet();
IdentityZone uaa = provisioning.retrieve(IdentityZone.getUaa().getId());
assertEquals(0, uaa.getConfig().getClientSecretPolicy().getMinLength());
assertEquals(255, uaa.getConfig().getClientSecretPolicy().getMaxLength());
assertEquals(0, uaa.getConfig().getClientSecretPolicy().getRequireUpperCaseCharacter());
assertEquals(1, uaa.getConfig().getClientSecretPolicy().getRequireLowerCaseCharacter());
assertEquals(1, uaa.getConfig().getClientSecretPolicy().getRequireDigit());
assertEquals(1, uaa.getConfig().getClientSecretPolicy().getRequireSpecialCharacter());
assertEquals(6, uaa.getConfig().getClientSecretPolicy().getExpireSecretInMonths());
}
@Test
>>>>>>>
public void testClientSecretPolicy() throws Exception {
bootstrap.setClientSecretPolicy(new ClientSecretPolicy(0, 255, 0, 1, 1, 1, 6));
bootstrap.afterPropertiesSet();
IdentityZone uaa = provisioning.retrieve(IdentityZone.getUaa().getId());
assertEquals(0, uaa.getConfig().getClientSecretPolicy().getMinLength());
assertEquals(255, uaa.getConfig().getClientSecretPolicy().getMaxLength());
assertEquals(0, uaa.getConfig().getClientSecretPolicy().getRequireUpperCaseCharacter());
assertEquals(1, uaa.getConfig().getClientSecretPolicy().getRequireLowerCaseCharacter());
assertEquals(1, uaa.getConfig().getClientSecretPolicy().getRequireDigit());
assertEquals(1, uaa.getConfig().getClientSecretPolicy().getRequireSpecialCharacter());
assertEquals(6, uaa.getConfig().getClientSecretPolicy().getExpireSecretInMonths());
}
@Test
public void test_multiple_keys() throws InvalidIdentityZoneDetailsException {
bootstrap.setSamlSpPrivateKey(SamlTestUtils.PROVIDER_PRIVATE_KEY);
bootstrap.setSamlSpCertificate(SamlTestUtils.PROVIDER_CERTIFICATE);
bootstrap.setSamlSpPrivateKeyPassphrase(SamlTestUtils.PROVIDER_PRIVATE_KEY_PASSWORD);
Map<String, Map<String, String>> keys = new HashMap<>();
Map<String, String> key1 = new HashMap<>();
key1.put("key", SamlTestUtils.PROVIDER_PRIVATE_KEY);
key1.put("passphrase", SamlTestUtils.PROVIDER_PRIVATE_KEY_PASSWORD);
key1.put("certificate", SamlTestUtils.PROVIDER_CERTIFICATE);
keys.put("key1", key1);
bootstrap.setActiveKeyId("key1");
bootstrap.setSamlKeys(keys);
bootstrap.afterPropertiesSet();
IdentityZone uaa = provisioning.retrieve(IdentityZone.getUaa().getId());
SamlConfig config = uaa.getConfig().getSamlConfig();
assertEquals(SamlTestUtils.PROVIDER_PRIVATE_KEY, config.getPrivateKey());
assertEquals(SamlTestUtils.PROVIDER_PRIVATE_KEY_PASSWORD, config.getPrivateKeyPassword());
assertEquals(SamlTestUtils.PROVIDER_CERTIFICATE, config.getCertificate());
assertEquals("key1", config.getActiveKeyId());
assertEquals(2, config.getKeys().size());
assertEquals(SamlTestUtils.PROVIDER_PRIVATE_KEY, config.getKeys().get("key1").getKey());
assertEquals(SamlTestUtils.PROVIDER_PRIVATE_KEY_PASSWORD, config.getKeys().get("key1").getPassphrase());
assertEquals(SamlTestUtils.PROVIDER_CERTIFICATE, config.getKeys().get("key1").getCertificate());
}
@Test |
<<<<<<<
registerTestCase(new Above());
registerTestCase(new Below());
registerTestCase(new AutoNoBoundariesHasEnoughSpace());
registerTestCase(new AutoNoBoundariesHasNotEnoughSpace());
registerTestCase(new AutoWithBoundariesHasEnoughSpace());
registerTestCase(new AutoWithBoundariesHasNotEnoughSpace());
=======
registerTestCase(new EnabledDisabled());
>>>>>>>
registerTestCase(new EnabledDisabled());
registerTestCase(new Above());
registerTestCase(new Below());
registerTestCase(new AutoNoBoundariesHasEnoughSpace());
registerTestCase(new AutoNoBoundariesHasNotEnoughSpace());
registerTestCase(new AutoWithBoundariesHasEnoughSpace());
registerTestCase(new AutoWithBoundariesHasNotEnoughSpace()); |
<<<<<<<
import static de.adorsys.aspsp.xs2a.consent.api.CmsConsentStatus.EXPIRED;
import static de.adorsys.aspsp.xs2a.consent.api.CmsConsentStatus.RECEIVED;
import static de.adorsys.aspsp.xs2a.consent.api.CmsConsentStatus.VALID;
import static de.adorsys.aspsp.xs2a.consent.api.TypeAccess.ACCOUNT;
import static de.adorsys.aspsp.xs2a.consent.api.TypeAccess.BALANCE;
import static de.adorsys.aspsp.xs2a.consent.api.TypeAccess.TRANSACTION;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.EnumSet;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.Set;
import java.util.UUID;
import java.util.stream.Collectors;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import de.adorsys.aspsp.xs2a.account.AccountHolder;
=======
import de.adorsys.aspsp.xs2a.account.AccountAccessHolder;
>>>>>>>
import static de.adorsys.aspsp.xs2a.consent.api.CmsConsentStatus.EXPIRED;
import static de.adorsys.aspsp.xs2a.consent.api.CmsConsentStatus.RECEIVED;
import static de.adorsys.aspsp.xs2a.consent.api.CmsConsentStatus.VALID;
import static de.adorsys.aspsp.xs2a.consent.api.TypeAccess.ACCOUNT;
import static de.adorsys.aspsp.xs2a.consent.api.TypeAccess.BALANCE;
import static de.adorsys.aspsp.xs2a.consent.api.TypeAccess.TRANSACTION;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.EnumSet;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.Set;
import java.util.UUID;
import java.util.stream.Collectors;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import de.adorsys.aspsp.xs2a.account.AccountHolder;
<<<<<<<
=======
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.EnumSet;
import java.util.Optional;
import java.util.Set;
import java.util.UUID;
import static de.adorsys.aspsp.xs2a.consent.api.CmsConsentStatus.*;
import static de.adorsys.aspsp.xs2a.consent.api.TypeAccess.*;
>>>>>>>
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.EnumSet;
import java.util.Optional;
import java.util.Set;
import java.util.UUID;
import static de.adorsys.aspsp.xs2a.consent.api.CmsConsentStatus.*;
import static de.adorsys.aspsp.xs2a.consent.api.TypeAccess.*;
<<<<<<<
return buildAccounts(holder.getAccountAccesses());
}
private List<AisAccount> buildAccounts(Map<String, Set<AccountAccess>> accountAccesses) {
return accountAccesses
.entrySet().stream()
.map(e -> new AisAccount(e.getKey(), e.getValue()))
.collect(Collectors.toList());
=======
return holder.getAccountAccesses();
>>>>>>>
return buildAccounts(holder.getAccountAccesses());
}
private List<AisAccount> buildAccounts(Map<String, Set<AccountAccess>> accountAccesses) {
return accountAccesses
.entrySet().stream()
.map(e -> new AisAccount(e.getKey(), e.getValue()))
.collect(Collectors.toList());
<<<<<<<
private void checkAndUpdateConsentParameter(Optional<AisConsent> consent) {
if (consent.isPresent()) {
AisConsent aisConsent = consent.get();
checkAndUpdateOnExpiration(aisConsent);
updateAisConsentCounter(aisConsent);
}
}
private ActionStatus resolveConsentActionStatus(ConsentActionRequest request, Optional<AisConsent> consent) {
return consent.isPresent()
? request.getActionStatus()
: ActionStatus.BAD_PAYLOAD;
=======
private ActionStatus resolveConsentActionStatus(ConsentActionRequest request, AisConsent consent) {
return consent == null
? ActionStatus.BAD_PAYLOAD
: request.getActionStatus();
>>>>>>>
private ActionStatus resolveConsentActionStatus(ConsentActionRequest request, AisConsent consent) {
return consent == null
? ActionStatus.BAD_PAYLOAD
: request.getActionStatus();
<<<<<<<
/**
* Create consent authorization
*
* @param consentId
* @param request needed parameters for creating consent authorization
* @return String authorization id
*/
@Transactional
public Optional<String> createAuthorization(String consentId, AisConsentAuthorizationRequest request) {
return aisConsentRepository.findByExternalId(consentId)
.map(aisConsent -> {
AisConsentAuthorization consentAuthorization = new AisConsentAuthorization();
consentAuthorization.setExternalId(UUID.randomUUID().toString());
consentAuthorization.setScaStatus(request.getScaStatus());
consentAuthorization.setConsent(aisConsent);
consentAuthorization.setPsuId(request.getPsuId());
return aisConsentAuthorizationRepository.save(consentAuthorization).getExternalId();
});
}
/**
* Update consent authorization
*
* @param authorizationId
* @param consentAuthorization needed parameters for updating consent authorization
* @return Boolean
*/
@Transactional
public Optional<Boolean> updateConsentAuthorization(String authorizationId, AisConsentAuthorizationRequest consentAuthorization) {
return aisConsentAuthorizationRepository.findByExternalId(authorizationId)
.map(conAuth -> {
conAuth.setScaStatus(consentAuthorization.getScaStatus());
conAuth.setPassword(consentAuthorization.getPassword());
conAuth.setAuthenticationMethodId(consentAuthorization.getAuthenticationMethodId());
conAuth.setScaAuthenticationData(consentAuthorization.getScaAuthenticationData());
return aisConsentAuthorizationRepository.save(conAuth).getExternalId() != null;
});
}
=======
@Transactional
public Optional<String> updateAccountAccess(String consentId, CreateAisConsentRequest request) {
return getActualAisConsent(consentId)
.map(consent -> {
consent.addAccountAccess(readAccountAccess(request.getAccess()));
return aisConsentRepository.save(consent)
.getExternalId();
});
}
>>>>>>>
@Transactional
public Optional<String> updateAccountAccess(String consentId, CreateAisConsentRequest request) {
return getActualAisConsent(consentId)
.map(consent -> {
consent.addAccountAccess(readAccountAccess(request.getAccess()));
return aisConsentRepository.save(consent)
.getExternalId();
});
}
/**
* Create consent authorization
*
* @param consentId
* @param request needed parameters for creating consent authorization
* @return String authorization id
*/
@Transactional
public Optional<String> createAuthorization(String consentId, AisConsentAuthorizationRequest request) {
return aisConsentRepository.findByExternalId(consentId)
.map(aisConsent -> {
AisConsentAuthorization consentAuthorization = new AisConsentAuthorization();
consentAuthorization.setExternalId(UUID.randomUUID().toString());
consentAuthorization.setScaStatus(request.getScaStatus());
consentAuthorization.setConsent(aisConsent);
consentAuthorization.setPsuId(request.getPsuId());
return aisConsentAuthorizationRepository.save(consentAuthorization).getExternalId();
});
}
/**
* Update consent authorization
*
* @param authorizationId
* @param consentAuthorization needed parameters for updating consent authorization
* @return Boolean
*/
@Transactional
public Optional<Boolean> updateConsentAuthorization(String authorizationId, AisConsentAuthorizationRequest consentAuthorization) {
return aisConsentAuthorizationRepository.findByExternalId(authorizationId)
.map(conAuth -> {
conAuth.setScaStatus(consentAuthorization.getScaStatus());
conAuth.setPassword(consentAuthorization.getPassword());
conAuth.setAuthenticationMethodId(consentAuthorization.getAuthenticationMethodId());
conAuth.setScaAuthenticationData(consentAuthorization.getScaAuthenticationData());
return aisConsentAuthorizationRepository.save(conAuth).getExternalId() != null;
});
} |
<<<<<<<
import de.adorsys.aspsp.xs2a.domain.consent.AccountConsent;
=======
import de.adorsys.aspsp.xs2a.domain.consent.ConsentStatusResponse;
>>>>>>>
import de.adorsys.aspsp.xs2a.domain.consent.AccountConsent;
import de.adorsys.aspsp.xs2a.domain.consent.ConsentStatusResponse;
<<<<<<<
public ResponseObject mapToConsentInformationResponse200JsonResponseObject(ResponseObject<AccountConsent> accountConsentResponseObject) {
if (!accountConsentResponseObject.hasError()) {
return ResponseObject.builder().body(mapToConsentInformationResponse200Json(accountConsentResponseObject.getBody())).build();
}
return accountConsentResponseObject;
}
=======
public ResponseObject mapToConsentStatusResponse200ResponseObject(ResponseObject<ConsentStatusResponse> consentStatusResponse) {
if (!consentStatusResponse.hasError()) {
return ResponseObject.builder().body(mapToConsentStatusResponse200(consentStatusResponse.getBody())).build();
}
return consentStatusResponse;
}
private ConsentStatusResponse200 mapToConsentStatusResponse200(ConsentStatusResponse consentStatusResponse) {
return Optional.ofNullable(consentStatusResponse)
.map(cstr -> new ConsentStatusResponse200().consentStatus(ConsentStatus.fromValue(cstr.getConsentStatus())))
.orElse(null);
}
>>>>>>>
public ResponseObject mapToConsentStatusResponse200ResponseObject(ResponseObject<ConsentStatusResponse> consentStatusResponse) {
if (!consentStatusResponse.hasError()) {
return ResponseObject.builder().body(mapToConsentStatusResponse200(consentStatusResponse.getBody())).build();
}
return consentStatusResponse;
}
private ConsentStatusResponse200 mapToConsentStatusResponse200(ConsentStatusResponse consentStatusResponse) {
return Optional.ofNullable(consentStatusResponse)
.map(cstr -> new ConsentStatusResponse200().consentStatus(ConsentStatus.fromValue(cstr.getConsentStatus())))
.orElse(null);
}
public ResponseObject mapToConsentInformationResponse200JsonResponseObject(ResponseObject<AccountConsent> accountConsentResponseObject) {
if (!accountConsentResponseObject.hasError()) {
return ResponseObject.builder().body(mapToConsentInformationResponse200Json(accountConsentResponseObject.getBody())).build();
}
return accountConsentResponseObject;
} |
<<<<<<<
import java.util.Optional;
=======
import java.util.List;
import java.util.Set;
>>>>>>>
import java.util.List;
import java.util.Set;
import java.util.Optional;
<<<<<<<
Optional<AisConsent> findAisConsentByExternalId(String externalId);
=======
List<AisConsent> findByConsentStatusIn(Set<AisConsentStatus> statuses);
>>>>>>>
List<AisConsent> findByConsentStatusIn(Set<AisConsentStatus> statuses);
Optional<AisConsent> findAisConsentByExternalId(String externalId); |
<<<<<<<
import de.adorsys.aspsp.xs2a.domain.consent.Xs2aUpdatePisConsentPsuDataRequest;
import de.adorsys.aspsp.xs2a.domain.consent.Xs2aUpdatePisConsentPsuDataResponse;
=======
import de.adorsys.aspsp.xs2a.domain.consent.pis.Xs2aUpdatePisConsentPsuDataRequest;
import de.adorsys.aspsp.xs2a.domain.consent.pis.Xs2aUpdatePisConsentPsuDataResponse;
import de.adorsys.aspsp.xs2a.service.authorization.pis.PisAuthorisationService;
>>>>>>>
import de.adorsys.aspsp.xs2a.domain.consent.Xs2aUpdatePisConsentPsuDataRequest;
import de.adorsys.aspsp.xs2a.domain.consent.Xs2aUpdatePisConsentPsuDataResponse;
import de.adorsys.aspsp.xs2a.domain.consent.pis.Xs2aUpdatePisConsentPsuDataRequest;
import de.adorsys.aspsp.xs2a.domain.consent.pis.Xs2aUpdatePisConsentPsuDataResponse;
import de.adorsys.aspsp.xs2a.service.authorization.pis.PisAuthorisationService;
<<<<<<<
import de.adorsys.aspsp.xs2a.service.mapper.consent.Xs2aPisConsentMapper;
import de.adorsys.aspsp.xs2a.service.mapper.spi_xs2a_mappers.SpiToXs2aAuthenticationObjectMapper;
=======
import de.adorsys.aspsp.xs2a.service.mapper.consent.SpiCmsPisMapper;
import de.adorsys.aspsp.xs2a.service.mapper.spi_xs2a_mappers.SpiErrorMapper;
>>>>>>>
import de.adorsys.aspsp.xs2a.service.mapper.consent.Xs2aPisConsentMapper;
import de.adorsys.aspsp.xs2a.service.mapper.spi_xs2a_mappers.SpiToXs2aAuthenticationObjectMapper;
import de.adorsys.aspsp.xs2a.service.mapper.consent.SpiCmsPisMapper;
import de.adorsys.aspsp.xs2a.service.mapper.spi_xs2a_mappers.SpiErrorMapper;
<<<<<<<
public PisScaAuthenticatedStage(PaymentAuthorisationSpi paymentAuthorisationSpi, PisConsentDataService pisConsentDataService, CmsToXs2aPaymentMapper cmsToXs2aPaymentMapper, Xs2aToSpiPeriodicPaymentMapper xs2aToSpiPeriodicPaymentMapper, Xs2aToSpiSinglePaymentMapper xs2aToSpiSinglePaymentMapper, Xs2aToSpiBulkPaymentMapper xs2aToSpiBulkPaymentMapper, SpiToXs2aAuthenticationObjectMapper spiToXs2aAuthenticationObjectMapper, Xs2aPisConsentMapper xs2aPisConsentMapper) {
super(paymentAuthorisationSpi, pisConsentDataService, cmsToXs2aPaymentMapper, xs2aToSpiPeriodicPaymentMapper, xs2aToSpiSinglePaymentMapper, xs2aToSpiBulkPaymentMapper, spiToXs2aAuthenticationObjectMapper, xs2aPisConsentMapper);
=======
public PisScaAuthenticatedStage(PisAuthorisationService pisAuthorisationService, PaymentAuthorisationSpi paymentAuthorisationSpi, SpiCmsPisMapper spiCmsPisMapper, PisConsentDataService pisConsentDataService, CmsToXs2aPaymentMapper cmsToXs2aPaymentMapper, Xs2aToSpiPeriodicPaymentMapper xs2aToSpiPeriodicPaymentMapper, Xs2aToSpiSinglePaymentMapper xs2aToSpiSinglePaymentMapper, Xs2aToSpiBulkPaymentMapper xs2aToSpiBulkPaymentMapper, SpiErrorMapper spiErrorMapper) {
super(pisAuthorisationService, paymentAuthorisationSpi, spiCmsPisMapper, pisConsentDataService, cmsToXs2aPaymentMapper, xs2aToSpiPeriodicPaymentMapper, xs2aToSpiSinglePaymentMapper, xs2aToSpiBulkPaymentMapper, spiErrorMapper);
>>>>>>>
public PisScaAuthenticatedStage(PaymentAuthorisationSpi paymentAuthorisationSpi, PisConsentDataService pisConsentDataService, CmsToXs2aPaymentMapper cmsToXs2aPaymentMapper, Xs2aToSpiPeriodicPaymentMapper xs2aToSpiPeriodicPaymentMapper, Xs2aToSpiSinglePaymentMapper xs2aToSpiSinglePaymentMapper, Xs2aToSpiBulkPaymentMapper xs2aToSpiBulkPaymentMapper, SpiToXs2aAuthenticationObjectMapper spiToXs2aAuthenticationObjectMapper, Xs2aPisConsentMapper xs2aPisConsentMapper) {
super(paymentAuthorisationSpi, pisConsentDataService, cmsToXs2aPaymentMapper, xs2aToSpiPeriodicPaymentMapper, xs2aToSpiSinglePaymentMapper, xs2aToSpiBulkPaymentMapper, spiToXs2aAuthenticationObjectMapper, xs2aPisConsentMapper);
public PisScaAuthenticatedStage(PisAuthorisationService pisAuthorisationService, PaymentAuthorisationSpi paymentAuthorisationSpi, SpiCmsPisMapper spiCmsPisMapper, PisConsentDataService pisConsentDataService, CmsToXs2aPaymentMapper cmsToXs2aPaymentMapper, Xs2aToSpiPeriodicPaymentMapper xs2aToSpiPeriodicPaymentMapper, Xs2aToSpiSinglePaymentMapper xs2aToSpiSinglePaymentMapper, Xs2aToSpiBulkPaymentMapper xs2aToSpiBulkPaymentMapper, SpiErrorMapper spiErrorMapper) {
super(pisAuthorisationService, paymentAuthorisationSpi, spiCmsPisMapper, pisConsentDataService, cmsToXs2aPaymentMapper, xs2aToSpiPeriodicPaymentMapper, xs2aToSpiSinglePaymentMapper, xs2aToSpiBulkPaymentMapper, spiErrorMapper); |
<<<<<<<
import java.math.BigInteger;
=======
import java.util.List;
>>>>>>>
import java.math.BigInteger;
import java.util.List;
<<<<<<<
*
* Please note that this is the SHA-3 FIPS 202 standard, not Keccak-256.
*
* @param src source string (hex encoding string)
* @return sha3-256 hash (hex encoding string)
=======
* 根据高度和原始种子数量,用特定的算法生成一个随机种子
*
* @param height 截止高度
* @param seedCount 原始种子数量
* @param algorithm 算法标识
* @return 32位随机数字节数组
*/
public static byte[] getRandomSeed(long height, int seedCount, String algorithm) {
//todo
return null;
}
public static byte[] getRandomSeed(long startHeight, long endHeight, String algorithm) {
//todo
return null;
}
public static List<byte[]> getRandomSeedList(long height, int seedCount) {
//todo
return null;
}
public static List<byte[]> getRandomSeedList(long height, long endHeight) {
//todo
return null;
}
/**
* @param src source string
* @return sha3-256 hash (utf-8 encode)
>>>>>>>
*
* Please note that this is the SHA-3 FIPS 202 standard, not Keccak-256.
*
* @param src source string (hex encoding string)
* @return sha3-256 hash (hex encoding string) |
<<<<<<<
=======
import de.adorsys.psd2.consent.service.security.DecryptedData;
import de.adorsys.psd2.consent.service.security.EncryptedData;
>>>>>>>
<<<<<<<
private final AspspDataService aspspDataService;
=======
private final AspspConsentDataRepository aspspConsentDataRepository;
>>>>>>>
private final AspspDataService aspspDataService;
<<<<<<<
Optional<AisConsent> aisConsent = getActualAisConsent(encryptedConsentId);
if (!aisConsent.isPresent()) {
return Optional.empty();
}
return Optional.ofNullable(request.getAspspConsentDataBase64())
.map(Base64.getDecoder()::decode)
.map(aspspConsentData -> new AspspConsentData(aspspConsentData, encryptedConsentId))
.map(aspspDataService::updateAspspConsentData)
.filter(BooleanUtils::isTrue)
.map(updated -> encryptedConsentId);
=======
Optional<AisConsent> consent = getActualAisConsent(encryptedConsentId);
if (!consent.isPresent()) {
return Optional.empty();
}
Optional<EncryptedData> encryptedConsentData = securityDataService.encryptConsentData(encryptedConsentId, request.getAspspConsentDataBase64());
if (!encryptedConsentData.isPresent()) {
return Optional.empty();
}
updateConsentData(consent.get().getExternalId(), encryptedConsentData.get().getData());
return Optional.of(encryptedConsentId);
>>>>>>>
Optional<AisConsent> aisConsent = getActualAisConsent(encryptedConsentId);
if (!aisConsent.isPresent()) {
return Optional.empty();
}
return Optional.ofNullable(request.getAspspConsentDataBase64())
.map(Base64.getDecoder()::decode)
.map(aspspConsentData -> new AspspConsentData(aspspConsentData, encryptedConsentId))
.map(aspspDataService::updateAspspConsentData)
.filter(BooleanUtils::isTrue)
.map(updated -> encryptedConsentId); |
<<<<<<<
import de.adorsys.aspsp.xs2a.domain.consent.Xs2aUpdatePisConsentPsuDataRequest;
import de.adorsys.aspsp.xs2a.domain.consent.Xs2aUpdatePisConsentPsuDataResponse;
=======
import de.adorsys.aspsp.xs2a.domain.consent.pis.Xs2aUpdatePisConsentPsuDataRequest;
import de.adorsys.aspsp.xs2a.domain.consent.pis.Xs2aUpdatePisConsentPsuDataResponse;
import de.adorsys.aspsp.xs2a.service.authorization.pis.PisAuthorisationService;
>>>>>>>
import de.adorsys.aspsp.xs2a.domain.consent.Xs2aUpdatePisConsentPsuDataRequest;
import de.adorsys.aspsp.xs2a.domain.consent.Xs2aUpdatePisConsentPsuDataResponse;
import de.adorsys.aspsp.xs2a.domain.consent.pis.Xs2aUpdatePisConsentPsuDataRequest;
import de.adorsys.aspsp.xs2a.domain.consent.pis.Xs2aUpdatePisConsentPsuDataResponse;
import de.adorsys.aspsp.xs2a.service.authorization.pis.PisAuthorisationService;
<<<<<<<
import de.adorsys.aspsp.xs2a.service.mapper.consent.Xs2aPisConsentMapper;
import de.adorsys.aspsp.xs2a.service.mapper.spi_xs2a_mappers.SpiToXs2aAuthenticationObjectMapper;
=======
import de.adorsys.aspsp.xs2a.service.mapper.consent.SpiCmsPisMapper;
import de.adorsys.aspsp.xs2a.service.mapper.spi_xs2a_mappers.SpiErrorMapper;
>>>>>>>
import de.adorsys.aspsp.xs2a.service.mapper.consent.Xs2aPisConsentMapper;
import de.adorsys.aspsp.xs2a.service.mapper.spi_xs2a_mappers.SpiToXs2aAuthenticationObjectMapper;
import de.adorsys.aspsp.xs2a.service.mapper.consent.SpiCmsPisMapper;
import de.adorsys.aspsp.xs2a.service.mapper.spi_xs2a_mappers.SpiErrorMapper;
<<<<<<<
public PisScaMethodSelectedStage(PaymentAuthorisationSpi paymentAuthorisationSpi, PisConsentDataService pisConsentDataService, CmsToXs2aPaymentMapper cmsToXs2aPaymentMapper, Xs2aToSpiPeriodicPaymentMapper xs2aToSpiPeriodicPaymentMapper, Xs2aToSpiSinglePaymentMapper xs2aToSpiSinglePaymentMapper, Xs2aToSpiBulkPaymentMapper xs2aToSpiBulkPaymentMapper, SpiToXs2aAuthenticationObjectMapper spiToXs2aAuthenticationObjectMapper, Xs2aPisConsentMapper xs2aPisConsentMapper) {
super(paymentAuthorisationSpi, pisConsentDataService, cmsToXs2aPaymentMapper, xs2aToSpiPeriodicPaymentMapper, xs2aToSpiSinglePaymentMapper, xs2aToSpiBulkPaymentMapper, spiToXs2aAuthenticationObjectMapper, xs2aPisConsentMapper);
=======
public PisScaMethodSelectedStage(PisAuthorisationService pisAuthorisationService, PaymentAuthorisationSpi paymentAuthorisationSpi, SpiCmsPisMapper spiCmsPisMapper, PisConsentDataService pisConsentDataService, CmsToXs2aPaymentMapper cmsToXs2aPaymentMapper, Xs2aToSpiPeriodicPaymentMapper xs2aToSpiPeriodicPaymentMapper, Xs2aToSpiSinglePaymentMapper xs2aToSpiSinglePaymentMapper, Xs2aToSpiBulkPaymentMapper xs2aToSpiBulkPaymentMapper, SpiErrorMapper spiErrorMapper) {
super(pisAuthorisationService, paymentAuthorisationSpi, spiCmsPisMapper, pisConsentDataService, cmsToXs2aPaymentMapper, xs2aToSpiPeriodicPaymentMapper, xs2aToSpiSinglePaymentMapper, xs2aToSpiBulkPaymentMapper, spiErrorMapper);
>>>>>>>
public PisScaMethodSelectedStage(PaymentAuthorisationSpi paymentAuthorisationSpi, PisConsentDataService pisConsentDataService, CmsToXs2aPaymentMapper cmsToXs2aPaymentMapper, Xs2aToSpiPeriodicPaymentMapper xs2aToSpiPeriodicPaymentMapper, Xs2aToSpiSinglePaymentMapper xs2aToSpiSinglePaymentMapper, Xs2aToSpiBulkPaymentMapper xs2aToSpiBulkPaymentMapper, SpiToXs2aAuthenticationObjectMapper spiToXs2aAuthenticationObjectMapper, Xs2aPisConsentMapper xs2aPisConsentMapper) {
super(paymentAuthorisationSpi, pisConsentDataService, cmsToXs2aPaymentMapper, xs2aToSpiPeriodicPaymentMapper, xs2aToSpiSinglePaymentMapper, xs2aToSpiBulkPaymentMapper, spiToXs2aAuthenticationObjectMapper, xs2aPisConsentMapper);
<<<<<<<
// TODO check the paymentSpi result first https://git.adorsys.de/adorsys/xs2a/aspsp-xs2a/issues/338
Xs2aUpdatePisConsentPsuDataResponse xs2aResponse = new Xs2aUpdatePisConsentPsuDataResponse(FINALISED);
xs2aResponse.setPsuId(psuData.getPsuId());
return xs2aResponse;
=======
if (spiResponse.hasError()) {
return new Xs2aUpdatePisConsentPsuDataResponse(spiErrorMapper.mapToErrorHolder(spiResponse));
}
request.setScaStatus(FINALISED); // TODO check the paymentSpi result first https://git.adorsys.de/adorsys/xs2a/aspsp-xs2a/issues/338
return pisAuthorisationService.doUpdatePisConsentAuthorisation(request);
>>>>>>>
if (spiResponse.hasError()) {
return new Xs2aUpdatePisConsentPsuDataResponse(spiErrorMapper.mapToErrorHolder(spiResponse));
}
// TODO check the paymentSpi result first https://git.adorsys.de/adorsys/xs2a/aspsp-xs2a/issues/338
Xs2aUpdatePisConsentPsuDataResponse xs2aResponse = new Xs2aUpdatePisConsentPsuDataResponse(FINALISED);
xs2aResponse.setPsuId(psuData.getPsuId());
return xs2aResponse; |
<<<<<<<
import de.adorsys.aspsp.xs2a.spi.domain.v2.SpiPeriodicPayment;
=======
import de.adorsys.aspsp.xs2a.spi.domain.v2.SpiSinglePayment;
>>>>>>>
import de.adorsys.aspsp.xs2a.spi.domain.v2.SpiPeriodicPayment;
import de.adorsys.aspsp.xs2a.spi.domain.v2.SpiSinglePayment;
<<<<<<<
private final Xs2aToSpiPeriodicPaymentMapper xs2aToSpiPeriodicPaymentMapper;
=======
private final SpiToXs2aPaymentMapper spiToXs2aPaymentMapper;
>>>>>>>
private final Xs2aToSpiPeriodicPaymentMapper xs2aToSpiPeriodicPaymentMapper;
private final SpiToXs2aPaymentMapper spiToXs2aPaymentMapper; |
<<<<<<<
import de.adorsys.aspsp.xs2a.spi.domain.account.SpiAccountConsentAuthorization;
import de.adorsys.aspsp.xs2a.spi.domain.consent.*;
import de.adorsys.aspsp.xs2a.spi.domain.psu.SpiScaMethod;
=======
import de.adorsys.aspsp.xs2a.spi.domain.consent.AspspConsentData;
import de.adorsys.aspsp.xs2a.spi.domain.consent.SpiAccountAccess;
import de.adorsys.aspsp.xs2a.spi.domain.consent.SpiAccountAccessType;
import de.adorsys.aspsp.xs2a.spi.domain.consent.SpiConsentStatus;
>>>>>>>
import de.adorsys.aspsp.xs2a.spi.domain.account.SpiAccountConsentAuthorization;
import de.adorsys.aspsp.xs2a.spi.domain.consent.*;
import de.adorsys.aspsp.xs2a.spi.domain.psu.SpiScaMethod;
import de.adorsys.aspsp.xs2a.spi.domain.consent.AspspConsentData;
import de.adorsys.aspsp.xs2a.spi.domain.consent.SpiAccountAccess;
import de.adorsys.aspsp.xs2a.spi.domain.consent.SpiAccountAccessType;
import de.adorsys.aspsp.xs2a.spi.domain.consent.SpiConsentStatus;
<<<<<<<
public List<CmsScaMethod> mapToCmsScaMethods(List<SpiScaMethod> spiScaMethods) {
return spiScaMethods.stream()
.map(this::mapToCmsScaMethod)
.collect(Collectors.toList());
}
private CmsScaMethod mapToCmsScaMethod(SpiScaMethod spiScaMethod) {
return CmsScaMethod.valueOf(spiScaMethod.name());
}
private CmsScaStatus mapToCmsScaStatus(SpiScaStatus status) {
=======
private CmsScaStatus mapToCmsScaStatus(Xs2aScaStatus status) {
>>>>>>>
public List<CmsScaMethod> mapToCmsScaMethods(List<SpiScaMethod> spiScaMethods) {
return spiScaMethods.stream()
.map(this::mapToCmsScaMethod)
.collect(Collectors.toList());
}
private CmsScaMethod mapToCmsScaMethod(SpiScaMethod spiScaMethod) {
return CmsScaMethod.valueOf(spiScaMethod.name());
}
private CmsScaStatus mapToCmsScaStatus(Xs2aScaStatus status) { |
<<<<<<<
@Given("^PSU wants to initiate a single payment (.*) using the payment product (.*)$")
public void loadTestData(String dataFileName, String paymentProduct) throws IOException {
=======
private String dataFileName;
@Given("^PSU wants to initiate a single payment (.*) using the payment service (.*) and the payment product (.*)$")
public void loadTestData(String dataFileName, String paymentService, String paymentProduct) throws IOException {
>>>>>>>
@Given("^PSU wants to initiate a single payment (.*) using the payment product (.*)$")
public void loadTestData(String dataFileName, String paymentProduct) throws IOException {
<<<<<<<
=======
context.setPaymentService(paymentService);
this.dataFileName = dataFileName;
>>>>>>>
<<<<<<<
HttpEntity<SinglePayment> entity = getSinglePaymentsHttpEntity();
=======
HttpEntity<PaymentInitiationSctJson> entity = getSinglePaymentsHttpEntity();
>>>>>>>
HttpEntity<PaymentInitiationSctJson> entity = getSinglePaymentsHttpEntity(); |
<<<<<<<
=======
import de.adorsys.psd2.xs2a.domain.consent.pis.Xs2aUpdatePisCommonPaymentPsuDataRequest;
import de.adorsys.psd2.xs2a.domain.consent.pis.Xs2aUpdatePisCommonPaymentPsuDataResponse;
>>>>>>>
<<<<<<<
=======
// TODO extract this method to PaymentAuthorisationService https://git.adorsys.de/adorsys/xs2a/aspsp-xs2a/issues/507
public ResponseObject<Xsa2CreatePisAuthorisationResponse> createPisAuthorization(String paymentId, PaymentType paymentType, PsuIdData psuData) {
xs2aEventService.recordPisTppRequest(paymentId, EventType.START_PAYMENT_AUTHORISATION_REQUEST_RECEIVED);
return pisAuthorizationService.createCommonPaymentAuthorisation(paymentId, paymentType, psuData)
.map(resp -> ResponseObject.<Xsa2CreatePisAuthorisationResponse>builder()
.body(resp)
.build())
.orElseGet(ResponseObject.<Xsa2CreatePisAuthorisationResponse>builder()
.fail(new MessageError(MessageErrorCode.PAYMENT_FAILED))
::build);
}
// TODO extract this method to PaymentAuthorisationService https://git.adorsys.de/adorsys/xs2a/aspsp-xs2a/issues/507
public ResponseObject<Xs2aUpdatePisCommonPaymentPsuDataResponse> updatePisCommonPaymentPsuData(Xs2aUpdatePisCommonPaymentPsuDataRequest request) {
xs2aEventService.recordPisTppRequest(request.getPaymentId(), EventType.UPDATE_PAYMENT_AUTHORISATION_PSU_DATA_REQUEST_RECEIVED, request);
Xs2aUpdatePisCommonPaymentPsuDataResponse response = pisAuthorizationService.updateCommonPaymentPsuData(request);
if (response.hasError()) {
return ResponseObject.<Xs2aUpdatePisCommonPaymentPsuDataResponse>builder()
.fail(new MessageError(response.getErrorHolder().getErrorCode(), response.getErrorHolder().getMessage()))
.build();
}
return ResponseObject.<Xs2aUpdatePisCommonPaymentPsuDataResponse>builder()
.body(response)
.build();
}
// TODO extract this method to PaymentCancellationAuthorisationService https://git.adorsys.de/adorsys/xs2a/aspsp-xs2a/issues/507
public ResponseObject<Xs2aCreatePisCancellationAuthorisationResponse> createPisCancellationAuthorization(String paymentId, PsuIdData psuData, PaymentType paymentType) {
xs2aEventService.recordPisTppRequest(paymentId, EventType.START_PAYMENT_CANCELLATION_AUTHORISATION_REQUEST_RECEIVED);
if (!isPsuDataCorrect(paymentId, psuData)) {
return ResponseObject.<Xs2aCreatePisCancellationAuthorisationResponse>builder()
.fail(new MessageError(MessageErrorCode.PSU_CREDENTIALS_INVALID))
.build();
}
return pisAuthorizationService.createCommonPaymentCancellationAuthorisation(paymentId, paymentType, psuData)
.map(resp -> ResponseObject.<Xs2aCreatePisCancellationAuthorisationResponse>builder()
.body(resp)
.build())
.orElseGet(ResponseObject.<Xs2aCreatePisCancellationAuthorisationResponse>builder()
.fail(new MessageError(MessageErrorCode.FORMAT_ERROR))
::build);
}
private boolean isPsuDataCorrect(String paymentId, PsuIdData psuData) {
List<PsuIdData> psuIdDataList = pisPsuDataService.getPsuDataByPaymentId(paymentId);
return psuIdDataList.stream()
.anyMatch(psu -> psu.contentEquals(psuData));
}
// TODO extract this method to PaymentCancellationAuthorisationService https://git.adorsys.de/adorsys/xs2a/aspsp-xs2a/issues/507
public ResponseObject<Xs2aUpdatePisCommonPaymentPsuDataResponse> updatePisCancellationPsuData(Xs2aUpdatePisCommonPaymentPsuDataRequest request) {
xs2aEventService.recordPisTppRequest(request.getPaymentId(), EventType.UPDATE_PAYMENT_CANCELLATION_PSU_DATA_REQUEST_RECEIVED, request);
Xs2aUpdatePisCommonPaymentPsuDataResponse response = pisAuthorizationService.updateCommonPaymentCancellationPsuData(request);
if (response.hasError()) {
return ResponseObject.<Xs2aUpdatePisCommonPaymentPsuDataResponse>builder()
.fail(new MessageError(response.getErrorHolder().getErrorCode(), response.getErrorHolder().getMessage()))
.build();
}
return ResponseObject.<Xs2aUpdatePisCommonPaymentPsuDataResponse>builder()
.body(response)
.build();
}
// TODO extract this method to PaymentCancellationAuthorisationService https://git.adorsys.de/adorsys/xs2a/aspsp-xs2a/issues/507
public ResponseObject<Xs2aPaymentCancellationAuthorisationSubResource> getPaymentInitiationCancellationAuthorisationInformation(String paymentId) {
xs2aEventService.recordPisTppRequest(paymentId, EventType.GET_PAYMENT_CANCELLATION_AUTHORISATION_REQUEST_RECEIVED);
return pisAuthorizationService.getCancellationAuthorisationSubResources(paymentId)
.map(resp -> ResponseObject.<Xs2aPaymentCancellationAuthorisationSubResource>builder().body(resp).build())
.orElseGet(ResponseObject.<Xs2aPaymentCancellationAuthorisationSubResource>builder()
.fail(new MessageError(MessageErrorCode.RESOURCE_UNKNOWN_404))
::build);
}
public ResponseObject<Xs2aAuthorisationSubResources> getPaymentInitiationAuthorisations(String paymentId) {
xs2aEventService.recordPisTppRequest(paymentId, EventType.GET_PAYMENT_AUTHORISATION_REQUEST_RECEIVED);
return pisAuthorizationService.getAuthorisationSubResources(paymentId)
.map(resp -> ResponseObject.<Xs2aAuthorisationSubResources>builder().body(resp).build())
.orElseGet(ResponseObject.<Xs2aAuthorisationSubResources>builder()
.fail(new MessageError(MessageErrorCode.RESOURCE_UNKNOWN_404))
::build);
}
>>>>>>> |
<<<<<<<
import java.util.Collections;
import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;
=======
import java.util.List;
import java.util.stream.Collectors;
>>>>>>>
import java.util.Collections;
import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;
import java.util.List;
import java.util.stream.Collectors; |
<<<<<<<
ResponseObject<Xs2aAccountAccess> getValidatedConsent(String consentId) {
AccountConsent consent = consentMapper.mapToAccountConsent(aisConsentService.getAccountConsentById(consentId));
=======
ResponseObject<AccountAccess> getValidatedConsent(String consentId) {
AccountConsent consent = aisConsentMapper.mapToAccountConsent(consentSpi.getAccountConsentById(consentId));
>>>>>>>
ResponseObject<Xs2aAccountAccess> getValidatedConsent(String consentId) {
AccountConsent consent = aisConsentMapper.mapToAccountConsent(consentSpi.getAccountConsentById(consentId)); |
<<<<<<<
import de.adorsys.psd2.consent.api.pis.authorisation.UpdatePisConsentPsuDataRequest;
import de.adorsys.psd2.consent.api.service.PisConsentService;
=======
import de.adorsys.psd2.consent.api.pis.authorisation.UpdatePisConsentPsuDataResponse;
import de.adorsys.psd2.xs2a.core.psu.PsuIdData;
>>>>>>>
import de.adorsys.psd2.consent.api.pis.authorisation.UpdatePisConsentPsuDataRequest;
import de.adorsys.psd2.consent.api.service.PisConsentService;
import de.adorsys.psd2.xs2a.core.psu.PsuIdData;
<<<<<<<
public CreatePisConsentAuthorisationResponse createPisConsentAuthorisation(String paymentId) {
return pisConsentService.createAuthorization(paymentId, CmsAuthorisationType.CREATED)
.orElse(null);
=======
public CreatePisConsentAuthorisationResponse createPisConsentAuthorisation(String paymentId, PsuIdData psuData) {
return consentRestTemplate.postForEntity(remotePisConsentUrls.createPisConsentAuthorisation(),
psuData, CreatePisConsentAuthorisationResponse.class, paymentId)
.getBody();
>>>>>>>
public CreatePisConsentAuthorisationResponse createPisConsentAuthorisation(String paymentId, PsuIdData psuData) {
return pisConsentService.createAuthorization(paymentId, CmsAuthorisationType.CREATED)
.orElse(null);
<<<<<<<
public CreatePisConsentAuthorisationResponse createPisConsentAuthorisationCancellation(String paymentId) {
return pisConsentService.createAuthorization(paymentId, CmsAuthorisationType.CANCELLED)
.orElse(null);
=======
public CreatePisConsentAuthorisationResponse createPisConsentAuthorisationCancellation(String paymentId, PsuIdData psuData) {
return consentRestTemplate.postForEntity(remotePisConsentUrls.createPisConsentAuthorisationCancellation(),
psuData, CreatePisConsentAuthorisationResponse.class, paymentId)
.getBody();
>>>>>>>
public CreatePisConsentAuthorisationResponse createPisConsentAuthorisationCancellation(String paymentId, PsuIdData psuData) {
return pisConsentService.createAuthorization(paymentId, CmsAuthorisationType.CANCELLED)
.orElse(null); |
<<<<<<<
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
=======
import de.adorsys.psd2.xs2a.core.psu.PsuIdData;
import lombok.Value;
>>>>>>>
import de.adorsys.psd2.xs2a.core.psu.PsuIdData;
import lombok.Value;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor; |
<<<<<<<
=======
import de.adorsys.aspsp.xs2a.exception.MessageCategory;
import de.adorsys.aspsp.xs2a.exception.MessageError;
import de.adorsys.aspsp.xs2a.service.validator.ValidationGroup;
import de.adorsys.aspsp.xs2a.service.validator.ValueValidatorService;
>>>>>>>
import de.adorsys.aspsp.xs2a.exception.MessageCategory;
import de.adorsys.aspsp.xs2a.exception.MessageError;
import de.adorsys.aspsp.xs2a.service.validator.ValidationGroup;
import de.adorsys.aspsp.xs2a.service.validator.ValueValidatorService;
<<<<<<<
import org.hibernate.validator.constraints.NotEmpty;
=======
>>>>>>>
<<<<<<<
import javax.validation.constraints.NotNull;
import java.util.*;
import static org.springframework.hateoas.mvc.ControllerLinkBuilder.linkTo;
=======
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import static org.springframework.hateoas.mvc.ControllerLinkBuilder.linkTo;
>>>>>>>
import javax.validation.constraints.NotNull;
import java.util.*;
import static org.springframework.hateoas.mvc.ControllerLinkBuilder.linkTo;
<<<<<<<
public ResponseObject<AccountReport> getAccountReport(@NotEmpty String accountId, Date dateFrom,
Date dateTo, String transactionId,
=======
public ResponseObject<AccountReport> getAccountReport(String accountId, Date dateFrom,
Date dateTo, String transactionId,
>>>>>>>
public ResponseObject<AccountReport> getAccountReport(String accountId, Date dateFrom,
Date dateTo, String transactionId,
<<<<<<<
Optional<AccountReport> accountReport = StringUtils.isEmpty(transactionId)
? readTransactionsByPeriod(accountId, dateFrom, dateTo, psuInvolved, withBalance)
: readTransactionsById(accountId, transactionId, psuInvolved, withBalance);
return accountReport.map(accountReport1 ->
new ResponseObject<>(getReportAccordingMaxSize(accountReport1, accountId)))
.orElseGet(() ->
new ResponseObject(getReportAccordingMaxSize(new AccountReport(new Transactions[]{}, new Transactions[]{}, new Links()), accountId)));
=======
AccountReport accountReport = StringUtils.isEmpty(transactionId)
? getAccountReportByPeriod(accountId, dateFrom, dateTo, psuInvolved, withBalance)
: getAccountReportByTransaction(accountId, transactionId, psuInvolved, withBalance);
return accountReport == null
? new ResponseObject<>(new MessageError(new TppMessageInformation(MessageCategory.ERROR, MessageCode.RESOURCE_UNKNOWN_404)))
: new ResponseObject<>(getReportAccordingMaxSize(accountReport, accountId));
>>>>>>>
AccountReport accountReport = StringUtils.isEmpty(transactionId)
? getAccountReportByPeriod(accountId, dateFrom, dateTo, psuInvolved, withBalance)
: getAccountReportByTransaction(accountId, transactionId, psuInvolved, withBalance);
return accountReport.map(accountReport1 ->
new ResponseObject<>(getReportAccordingMaxSize(accountReport1, accountId)))
.orElseGet(() ->
new ResponseObject(getReportAccordingMaxSize(new AccountReport(new Transactions[]{}, new Transactions[]{}, new Links()), accountId)));
<<<<<<<
private Optional<AccountReport> readTransactionsByPeriod(@NotEmpty String accountId, @NotNull Date dateFrom,
@NotNull Date dateTo, boolean psuInvolved, boolean withBalance) {
=======
private AccountReport readTransactionsByPeriod(String accountId, Date dateFrom,
Date dateTo, boolean psuInvolved, boolean withBalance) {
>>>>>>>
private AccountReport readTransactionsByPeriod(String accountId, Date dateFrom,
Date dateTo, boolean psuInvolved, boolean withBalance) {
<<<<<<<
private Optional<AccountReport> readTransactionsById(@NotEmpty String accountId, @NotEmpty String transactionId,
boolean psuInvolved, boolean withBalance) {
=======
private AccountReport readTransactionsById(String accountId, String transactionId,
boolean psuInvolved, boolean withBalance) {
>>>>>>>
private AccountReport readTransactionsById(String accountId, String transactionId,
boolean psuInvolved, boolean withBalance) { |
<<<<<<<
import de.adorsys.aspsp.xs2a.exception.MessageCategory;
import de.adorsys.aspsp.xs2a.exception.MessageError;
=======
>>>>>>>
import de.adorsys.aspsp.xs2a.exception.MessageCategory;
import de.adorsys.aspsp.xs2a.exception.MessageError;
<<<<<<<
when(consentService.getIbansFromAccountReference(new AccountReference[]{getAccountReference()})).thenReturn(new HashSet<>(Collections.singletonList(IBAN)));
//getAccountsByConsent Success no balances
=======
when(consentService.getAccountConsentById(CONSENT_ID)).thenReturn(ResponseObject.<AccountConsent>builder().body(getAccountConsent(CONSENT_ID)).build());
when(consentService.getIbanSetFromAccess(getAccountConsent(CONSENT_ID).getAccess())).thenReturn(new HashSet<>(Collections.singletonList(getAccountDetails().getIban())));
when(accountSpi.readAccountDetailsByIban(IBAN))
.thenReturn(Collections.singletonList(getSpiAccountDetails()));
/* when(accountSpi.readTransactionsByPeriod(any(), any(), any()))
.thenReturn(getTransactionList());
when(accountSpi.readBalances(any()))
.thenReturn(getBalances());
when(accountSpi.readTransactionsById(any(), any()))
.thenReturn(getTransactionList());
when(accountSpi.readAccountDetailsByIban(anyString()))
.thenReturn(Collections.singletonList(createSpiAccountDetails()));
>>>>>>>
when(consentService.getIbansFromAccountReference(new AccountReference[]{getAccountReference()})).thenReturn(new HashSet<>(Collections.singletonList(IBAN)));
when(accountSpi.readAccountDetailsByIban(IBAN))
.thenReturn(Collections.singletonList(getSpiAccountDetails()));
//getAccountsByConsent Success no balances
<<<<<<<
assertThat(response.hasError()).isEqualTo(true);
assertThat(response.getError().getTransactionStatus()).isEqualTo(TransactionStatus.RJCT);
assertThat(response.getError().getTppMessage().getCode()).isEqualTo(MessageCode.CONSENT_UNKNOWN_403);
=======
assertThat(response.getBody()).isEqualTo(getAccountReportDummy());
}
@Test
public void getAccountBalancesByAccountReference_referenceIsNull() {
// Given:
AccountReference reference = null;
//When:
List<Balances> actualResult = accountService.getAccountBalancesByAccountReference(reference);
//Then:
assertThat(actualResult).isEmpty();
}
@Test
public void getAccountBalancesByAccountReference() {
// Given:
AccountReference reference = new AccountReference();
reference.setIban(IBAN);
reference.setCurrency(CURRENCY);
List<Balances> expectedResult = getBalancesList();
//When:
List<Balances> actualResult = accountService.getAccountBalancesByAccountReference(reference);
//Then:
assertThat(actualResult).isEqualTo(expectedResult);
}
@Test
public void getAccountBalancesByAccountReference_wrongCurrency() {
// Given:
AccountReference reference = new AccountReference();
reference.setIban(IBAN);
reference.setCurrency(Currency.getInstance("USD"));
//When:
List<Balances> actualResult = accountService.getAccountBalancesByAccountReference(reference);
//Then:
assertThat(actualResult).isEmpty();
}
@Test
public void getAccountBalancesByAccountReference_ibanIsNull() {
// Given:
AccountReference reference = new AccountReference();
reference.setIban(null);
reference.setCurrency(Currency.getInstance("USD"));
//When:
List<Balances> actualResult = accountService.getAccountBalancesByAccountReference(reference);
//Then:
assertThat(actualResult).isEmpty();
}
@Test
public void getAccountBalancesByAccountReference_currencyIsNull() {
// Given:
AccountReference reference = new AccountReference();
reference.setIban(IBAN);
reference.setCurrency(null);
//When:
List<Balances> actualResult = accountService.getAccountBalancesByAccountReference(reference);
//Then:
assertThat(actualResult).isEmpty();
}
/*
@Test //TODO Global test review
public void getAccountDetails_withBalance() throws IOException {
//Given:
boolean withBalance = true;
boolean psuInvolved = true;
AccountDetails expectedResult = new Gson().fromJson(IOUtils.resourceToString(ACCOUNT_DETAILS_SOURCE, UTF_8), AccountDetails.class);
//When:
ResponseObject<AccountDetails> result = accountService.getAccountDetails(ACCOUNT_ID, withBalance, psuInvolved);
//Then:
AccountDetails actualResult = result.getBody();
assertThat(actualResult.getAccountType()).isEqualTo(expectedResult.getAccountType());
assertThat(actualResult.getId()).isEqualTo(expectedResult.getId());
assertThat(actualResult.getIban()).isEqualTo(expectedResult.getIban());
assertThat(actualResult.getCurrency()).isEqualTo(expectedResult.getCurrency());
assertThat(actualResult.getName()).isEqualTo(expectedResult.getName());
assertThat(actualResult.getAccountType()).isEqualTo(expectedResult.getAccountType());
assertThat(actualResult.getBic()).isEqualTo(expectedResult.getBic());
}
@Test
public void getAccountDetails_withBalanceNoPsuInvolved() {
//Given:
boolean withBalance = true;
boolean psuInvolved = false;
checkAccountResults(withBalance, psuInvolved);
}
@Test
public void getAccountDetails_noBalanceNoPsuInvolved() {
//Given:
boolean withBalance = true;
boolean psuInvolved = false;
checkAccountResults(withBalance, psuInvolved);
}
@Test
public void getBalances_noPsuInvolved() {
//Given:
boolean psuInvolved = false;
checkBalanceResults(ACCOUNT_ID, psuInvolved);
>>>>>>>
assertThat(response.hasError()).isEqualTo(true);
assertThat(response.getError().getTransactionStatus()).isEqualTo(TransactionStatus.RJCT);
assertThat(response.getError().getTppMessage().getCode()).isEqualTo(MessageCode.CONSENT_UNKNOWN_403); |
<<<<<<<
@Bean
public FilterRegistrationBean corsFilterRegistrationBean() {
CorsConfiguration config = new CorsConfiguration();
config.applyPermitDefaultValues();
config.setAllowCredentials(corsConfigProperties.getAllowCredentials());
config.setAllowedOrigins(corsConfigProperties.getAllowedOrigins());
config.setAllowedHeaders(corsConfigProperties.getAllowedHeaders());
config.setAllowedMethods(corsConfigProperties.getAllowedMethods());
config.setMaxAge(corsConfigProperties.getMaxAge());
UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
source.registerCorsConfiguration("/**", config);
return new FilterRegistrationBean(new CorsFilter(source));
}
=======
@Bean
public MessageErrorMapper messageErrorMapper() {
return new MessageErrorMapper(new MessageService(messageSource()));
}
>>>>>>>
@Bean
public FilterRegistrationBean corsFilterRegistrationBean() {
CorsConfiguration config = new CorsConfiguration();
config.applyPermitDefaultValues();
config.setAllowCredentials(corsConfigProperties.getAllowCredentials());
config.setAllowedOrigins(corsConfigProperties.getAllowedOrigins());
config.setAllowedHeaders(corsConfigProperties.getAllowedHeaders());
config.setAllowedMethods(corsConfigProperties.getAllowedMethods());
config.setMaxAge(corsConfigProperties.getMaxAge());
UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
source.registerCorsConfiguration("/**", config);
return new FilterRegistrationBean(new CorsFilter(source));
}
@Bean
public MessageErrorMapper messageErrorMapper() {
return new MessageErrorMapper(new MessageService(messageSource()));
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.