conflict_resolution
stringlengths 27
16k
|
---|
<<<<<<<
=======
final IGraphicalFeature newModel = getModel().getTarget();
>>>>>>>
final IGraphicalFeature newModel = getModel().getTarget();
<<<<<<<
FeatureModelOperationWrapper.run(new ChangeFeatureGroupTypeOperation(groupType, feature.getName(), FeatureModelManager.getInstance(featureModel)));
=======
// Blocks unintentional FeatureGroupTypeChange when Parent is collapsed (Issue #806)
if (!newModel.isCollapsed()) {
final ChangeFeatureGroupTypeOperation op = new ChangeFeatureGroupTypeOperation(groupType, feature, featureModel);
try {
PlatformUI.getWorkbench().getOperationSupport().getOperationHistory().execute(op, null, null);
} catch (final ExecutionException e) {
FMUIPlugin.getDefault().logError(e);
}
}
>>>>>>>
// Blocks unintentional FeatureGroupTypeChange when Parent is collapsed (Issue #806)
if (!newModel.isCollapsed()) {
FeatureModelOperationWrapper.run(new ChangeFeatureGroupTypeOperation(groupType, feature.getName(), FeatureModelManager.getInstance(featureModel)));
} |
<<<<<<<
setChecked(FeatureModelManager.getAnalyzer(featureModel).isRunCalculationAutomatically());
=======
setChecked(featureModel.getAnalyser().runCalculationAutomatically);
setId(ID);
>>>>>>>
setChecked(FeatureModelManager.getAnalyzer(featureModel).isRunCalculationAutomatically());
setId(ID); |
<<<<<<<
public ConfigurationPage configurationPage;
public AdvancedConfigurationPage advancedConfigurationPage;
private TextEditorPage sourceEditorPage;
private final JobSynchronizer configJobManager = new JobSynchronizer();
=======
private final ConfigJobManager configJobManager = new ConfigJobManager();
>>>>>>>
public ConfigurationPage configurationPage;
public AdvancedConfigurationPage advancedConfigurationPage;
private final JobSynchronizer configJobManager = new JobSynchronizer(); |
<<<<<<<
public String toString() {
final StringBuilder sb = new StringBuilder();
// for (ImportDecl importDecl : importList) {
// sb.append("import ");
// sb.append(importDecl.typeName());
// sb.append(';');
// sb.append(LINE_SEPARATOR);
// }
// sb.append(super.toString());
// sb.append(LINE_SEPARATOR);
=======
public String toString() {
final StringBuilder sb = new StringBuilder();
// for (ImportDecl importDecl : importList) {
// sb.append("import ");
// sb.append(importDecl.typeName());
// sb.append(';');
// sb.append(LINE_SEPARATOR);
// }
// sb.append(super.toString());
// sb.append(LINE_SEPARATOR);
>>>>>>>
public String toString() {
final StringBuilder sb = new StringBuilder(); |
<<<<<<<
=======
* TODO This class represents the controller (MVC) of the constraint view it creates all GUI elements and holds the logic that operates on the view.
>>>>>>>
*
* This class represents the controller (MVC) of the constraint view it creates all GUI elements and holds the logic that operates on the view.
<<<<<<<
public static final String ID = FMUIPlugin.PLUGIN_ID + ".views.ConstraintView";
=======
public static final String ID = FMUIPlugin.PLUGIN_ID + ".views.constraintView";
>>>>>>>
public static final String ID = FMUIPlugin.PLUGIN_ID + ".views.ConstraintView";
<<<<<<<
=======
/**
* Standard SWT initialize called after construction.
*/
>>>>>>>
/**
* Standard SWT initialize called after construction.
*/
<<<<<<<
System.out.println(event.getEventType());
switch (event.getEventType()) {
case MODEL_DATA_LOADED:
case MODEL_DATA_SAVED:
System.out.println("model data loaded event triggered");
break;
default:
break;
}
=======
refreshView(currentModel);
>>>>>>>
refreshView(currentModel); |
<<<<<<<
FileHandler.load(Paths.get(currentConfig.getLocationURI()), config, ConfigFormatManager.getInstance());
=======
if (currentConfig != null) {
FileHandler.load(Paths.get(currentConfig.getLocationURI()), config, ConfigurationManager.getFormat(currentConfig.getName()));
}
>>>>>>>
if (currentConfig != null) {
FileHandler.load(Paths.get(currentConfig.getLocationURI()), config, ConfigFormatManager.getInstance());
} |
<<<<<<<
=======
import java.util.Arrays;
import java.util.Collection;
>>>>>>>
<<<<<<<
=======
public List<List<String>> getSolutions(int max) throws TimeoutException {
return LongRunningWrapper.runMethod(propagator.getSolutions(max));
}
>>>>>>>
<<<<<<<
=======
update(true, Arrays.asList(feature));
>>>>>>>
<<<<<<<
=======
public void update(boolean redundantManual, List<SelectableFeature> featureOrder) {
if (propagate) {
LongRunningWrapper.runMethod(propagator.update(redundantManual, featureOrder));
}
}
>>>>>>>
<<<<<<<
=======
/**
* Creates solutions to cover the given features.
*
* @param features The features that should be covered.
* @param selection true is the features should be selected, false otherwise.
*/
public List<List<String>> coverFeatures(Collection<String> features, IMonitor monitor, boolean selection) throws TimeoutException {
return LongRunningWrapper.runMethod(propagator.coverFeatures(features, selection), monitor);
}
public boolean isIgnoreAbstractFeatures() {
return ignoreAbstractFeatures;
}
>>>>>>> |
<<<<<<<
import de.ovgu.featureide.fm.ui.editors.featuremodel.GUIDefaults;
=======
import de.ovgu.featureide.fm.ui.editors.IGraphicalFeatureModel;
>>>>>>>
import de.ovgu.featureide.fm.ui.editors.featuremodel.GUIDefaults;
<<<<<<<
/**
* Standard SWT initialize called after construction.
=======
private final ConstraintViewController viewController = this;
private IFeatureModel featuremodel;
private IGraphicalFeatureModel graph_model;
boolean constraintsHidden = true;
/*
* (non-Javadoc)
* @see org.eclipse.ui.part.WorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite)
>>>>>>>
boolean constraintsHidden = true;
/**
* Standard SWT initialize called after construction.
<<<<<<<
=======
/*
* (non-Javadoc)
* @see org.eclipse.ui.part.WorkbenchPart#setFocus() viewController.getViewSite().getWorkbenchWindow().getActivePage() == viewController
*/
>>>>>>> |
<<<<<<<
super("Create Feature Below (Ins)", viewer, ID);
=======
super(CREATE_FEATURE_BELOW + " (Ins)", viewer);
>>>>>>>
super(CREATE_FEATURE_BELOW + " (Ins)", viewer, ID); |
<<<<<<<
=======
import de.ovgu.featureide.fm.core.color.FeatureColorManager;
import de.ovgu.featureide.fm.core.conf.ConfigurationFG;
import de.ovgu.featureide.fm.core.conf.IFeatureGraph;
import de.ovgu.featureide.fm.core.conf.MatrixFeatureGraph;
>>>>>>>
import de.ovgu.featureide.fm.core.color.FeatureColorManager;
<<<<<<<
import de.ovgu.featureide.fm.core.configuration.ConfigurationMatrix;
import de.ovgu.featureide.fm.core.configuration.ConfigurationPropagator;
import de.ovgu.featureide.fm.core.io.IPersistentFormat;
=======
import de.ovgu.featureide.fm.core.io.FeatureGraphFormat;
>>>>>>>
import de.ovgu.featureide.fm.core.configuration.ConfigurationPropagator;
<<<<<<<
public IFile file;
ModelMarkerHandler<IFile> markerHandler;
public FeatureProject featureProject;
public ConfigurationManager configurationManager;
public FeatureModelManager featureModelManager;
private int currentPageIndex = -1;
private boolean closeEditor;
private boolean autoSelectFeatures = false;
public boolean invalidFeatureModel = true;
private boolean containsError = true;
=======
private final List<IConfigurationEditorPage> allPages = new ArrayList<>(5);
private List<IConfigurationEditorPage> extensionPages;
private List<IConfigurationEditorPage> internalPages;
>>>>>>>
public FeatureProject featureProject;
private final List<IConfigurationEditorPage> allPages = new ArrayList<>(5);
private List<IConfigurationEditorPage> extensionPages;
private List<IConfigurationEditorPage> internalPages;
<<<<<<<
if (!EventType.MODEL_DATA_SAVED.equals(evt.getEventType())) {
return;
}
// TODO?
// configurationManager.read();
// final Configuration configuration = new Configuration(configurationManager.getObject(), featureModelManager.getObject());
// configuration.loadPropagator();
// LongRunningWrapper.runMethod(configuration.getPropagator().resolve());
//
// configurationManager.setObject(configuration);
// setContainsError(configurationManager.getLastProblems().containsError());
// Reinitialize the pages
final IConfigurationEditorPage currentPage = getPage(currentPageIndex);
if (currentPage != null) {
currentPage.propertyChange(evt);
=======
switch (evt.getEventType()) {
case MODEL_DATA_SAVED:
case MODEL_DATA_OVERRIDDEN:
case COLOR_CHANGED:
if (evt.getSource() instanceof IFeatureModel) {
final Configuration configuration = new Configuration(configurationManager.getObject(), featureModelManager.getObject());
configuration.loadPropagator();
LongRunningWrapper.runMethod(configuration.getPropagator().resolve());
configurationManager.setConfiguration(configuration);
setContainsError(false);
// Reinitialize the pages
final IConfigurationEditorPage currentPage = getPage(currentPageIndex);
if (currentPage != null) {
currentPage.propertyChange(evt);
}
} else if (evt.getSource() instanceof Configuration) {
// Reinitialize the pages
final IConfigurationEditorPage currentPage = getPage(currentPageIndex);
if (currentPage != null) {
currentPage.propertyChange(evt);
}
}
break;
default:
break;
>>>>>>>
switch (evt.getEventType()) {
case MODEL_DATA_SAVED:
case MODEL_DATA_OVERRIDDEN:
case COLOR_CHANGED:
if (evt.getSource() instanceof IFeatureModel) {
final Configuration configuration = new Configuration(configurationManager.getObject(), featureModelManager.getObject());
configurationManager.setObject(configuration);
setContainsError(false);
// Reinitialize the pages
final IConfigurationEditorPage currentPage = getPage(currentPageIndex);
if (currentPage != null) {
currentPage.propertyChange(evt);
}
} else if (evt.getSource() instanceof Configuration) {
// Reinitialize the pages
final IConfigurationEditorPage currentPage = getPage(currentPageIndex);
if (currentPage != null) {
currentPage.propertyChange(evt);
}
}
break;
default:
break;
<<<<<<<
@Override
public ConfigurationPropagator getPropagator() {
return featureProject.getStatus().getPropagator(getConfiguration());
}
=======
public ConfigurationManager getConfigurationManager() {
return configurationManager;
}
>>>>>>>
@Override
public ConfigurationPropagator getPropagator() {
return featureProject.getStatus().getPropagator(getConfiguration());
}
public ConfigurationManager getConfigurationManager() {
return configurationManager;
} |
<<<<<<<
import org.eclipse.gef.EditPartViewer;
=======
import org.eclipse.gef.editparts.ZoomListener;
import org.eclipse.gef.editparts.ZoomManager;
>>>>>>>
import org.eclipse.gef.EditPartViewer;
import org.eclipse.gef.editparts.ZoomListener;
import org.eclipse.gef.editparts.ZoomManager;
<<<<<<<
public static Dimension getLegendSize(FeatureModel featureModel) {
=======
private static ZoomManager zoomManager = null;
public static Dimension getLegendSize(FeatureModel featureModel) {
>>>>>>>
private static ZoomManager zoomManager = null;
public static Dimension getLegendSize(FeatureModel featureModel) {
<<<<<<<
if (newLocation == null)
=======
if (newLocation == null) {
>>>>>>>
if (newLocation == null) {
<<<<<<<
if (getLocation(feature) == null || getSize(feature) == null) {
// UIHelper not set up correctly, refresh the feature model
=======
if (getLocation(feature) == null || getSize(feature) == null) {
// UIHelper not set up correctly, refresh the feature model
>>>>>>>
if (getLocation(feature) == null || getSize(feature) == null) {
// UIHelper not set up correctly, refresh the feature model
<<<<<<<
=======
>>>>>>>
<<<<<<<
public static List<ConnectionEditPart> getConnections(Feature feature, EditPartViewer viewer) {
final List<ConnectionEditPart> editPartList = new LinkedList<ConnectionEditPart>();
final Map<?, ?> registry = viewer.getEditPartRegistry();
for (FeatureConnection connection : feature.getTargetConnections()) {
final Object connectionEditPart = registry.get(connection);
if (connectionEditPart instanceof ConnectionEditPart) {
editPartList.add((ConnectionEditPart) connectionEditPart);
}
}
return editPartList;
}
private static void fireLocationChanged(Feature feature, Point oldLocation, Point newLocation) {
PropertyChangeEvent event = new PropertyChangeEvent(feature, PropertyConstants.LOCATION_CHANGED, oldLocation, newLocation);
=======
private static void fireLocationChanged(Feature feature, Point oldLocation, Point newLocation) {
PropertyChangeEvent event = new PropertyChangeEvent(feature, PropertyConstants.LOCATION_CHANGED, oldLocation, newLocation);
>>>>>>>
public static List<ConnectionEditPart> getConnections(Feature feature, EditPartViewer viewer) {
final List<ConnectionEditPart> editPartList = new LinkedList<ConnectionEditPart>();
final Map<?, ?> registry = viewer.getEditPartRegistry();
for (FeatureConnection connection : feature.getTargetConnections()) {
final Object connectionEditPart = registry.get(connection);
if (connectionEditPart instanceof ConnectionEditPart) {
editPartList.add((ConnectionEditPart) connectionEditPart);
}
}
return editPartList;
}
private static void fireLocationChanged(Feature feature, Point oldLocation, Point newLocation) {
PropertyChangeEvent event = new PropertyChangeEvent(feature, PropertyConstants.LOCATION_CHANGED, oldLocation, newLocation);
<<<<<<<
while (!parentFeature.isRoot()) {
parentFeature = parentFeature.getParent();
if (parentFeature.isHidden())
parentFeatureHidden = true;
=======
while (!parentFeature.isRoot()) {
parentFeature = parentFeature.getParent();
if (parentFeature.isHidden()) {
parentFeatureHidden = true;
}
>>>>>>>
while (!parentFeature.isRoot()) {
parentFeature = parentFeature.getParent();
if (parentFeature.isHidden()) {
parentFeatureHidden = true;
}
<<<<<<<
if (hasVerticalLayout.contains(feature.getFeatureModel())) {
return new Point(bounds.getRight().x, (bounds.bottom() + bounds.getTop().y) / 2);
}
return new Point(bounds.getCenter().x, bounds.bottom() - 1);
}
=======
if (hasVerticalLayout.contains(feature.getFeatureModel())) {
return new Point(bounds.getRight().x, (bounds.bottom() + bounds.getTop().y) / 2);
}
return new Point(bounds.getCenter().x, bounds.bottom() - 1);
}
>>>>>>>
if (hasVerticalLayout.contains(feature.getFeatureModel())) {
return new Point(bounds.getRight().x, (bounds.bottom() + bounds.getTop().y) / 2);
}
return new Point(bounds.getCenter().x, bounds.bottom() - 1);
} |
<<<<<<<
import java.nio.file.Path;
import java.nio.file.Paths;
=======
import java.nio.file.Path;
>>>>>>>
import java.nio.file.Path;
import java.nio.file.Paths;
<<<<<<<
=======
import de.ovgu.featureide.fm.core.io.manager.IFileManager;
>>>>>>>
import de.ovgu.featureide.fm.core.io.manager.IFileManager;
<<<<<<<
public IFeatureModel featureModel;
=======
>>>>>>>
<<<<<<<
public IFeatureModel getFeatureModel() {
if (fmManager != null) {
return fmManager.editObject();
} else {
return featureModel;
}
}
public void setFeatureModel(IFeatureModel fm) {
featureModel = fm;
}
=======
public IFeatureModel getFeatureModel() {
return fmManager.editObject();
}
>>>>>>>
public IFeatureModel getFeatureModel() {
return fmManager.editObject();
}
<<<<<<<
final Path path = Paths.get(file.getLocationURI());
if (ProjectManager.hasProjectData(path )) {
featureProject = ProjectManager.getProject(path);
} else {
featureProject = ProjectManager.addProject(Paths.get(file.getProject().getLocationURI()), path);
}
fmManager = (FeatureModelManager) featureProject.getFeatureModelManager();
fmManager.addListener(this);
featureModel = fmManager.editObject();
=======
final Path path = markerHandler.getModelFile().getLocation().toFile().toPath();
fmManager = FeatureModelManager.getInstance(path);
>>>>>>>
final Path path = Paths.get(file.getLocationURI());
if (ProjectManager.hasProjectData(path)) {
featureProject = ProjectManager.getProject(path);
} else {
featureProject = ProjectManager.addProject(Paths.get(file.getProject().getLocationURI()), path);
}
fmManager = (FeatureModelManager) featureProject.getFeatureModelManager();
fmManager.addListener(this);
<<<<<<<
if (!ProjectManager.getAnalyzer(featureModel).isValid()) {
markerHandler.createModelMarker(THE_FEATURE_MODEL_IS_VOID_COMMA__I_E__COMMA__IT_CONTAINS_NO_PRODUCTS, IMarker.SEVERITY_ERROR, 0);
=======
try {
if (!getFeatureModel().getAnalyser().isValid()) {
markerHandler.createModelMarker(THE_FEATURE_MODEL_IS_VOID_COMMA__I_E__COMMA__IT_CONTAINS_NO_PRODUCTS, IMarker.SEVERITY_ERROR, 0);
}
} catch (TimeoutException e) {
// do nothing, assume the model is correct
>>>>>>>
if (!ProjectManager.getAnalyzer(getFeatureModel()).isValid()) {
markerHandler.createModelMarker(THE_FEATURE_MODEL_IS_VOID_COMMA__I_E__COMMA__IT_CONTAINS_NO_PRODUCTS, IMarker.SEVERITY_ERROR, 0); |
<<<<<<<
=======
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.LinkedList;
>>>>>>>
import java.util.ArrayList;
import java.util.HashMap;
<<<<<<<
=======
import java.util.Map;
import java.util.Set;
>>>>>>>
import java.util.Map;
<<<<<<<
=======
import de.ovgu.featureide.fm.core.base.IFeatureModel;
import de.ovgu.featureide.fm.core.base.IFeatureModelFactory;
import de.ovgu.featureide.fm.core.base.IFeatureStructure;
import de.ovgu.featureide.fm.core.base.IPropertyContainer.Entry;
import de.ovgu.featureide.fm.core.base.IPropertyContainer.Type;
>>>>>>>
import de.ovgu.featureide.fm.core.base.IFeatureStructure;
<<<<<<<
public XmlExtendedFeatureModelFormat() {
super();
}
=======
private Map<String, Map<String, String>> recursiveLookup = new HashMap<>();
public XmlExtendedFeatureModelFormat() {}
>>>>>>>
private Map<String, Map<String, String>> recursiveLookup = new HashMap<>();
public XmlExtendedFeatureModelFormat() {
super();
}
<<<<<<<
throwError("Unknown feature attribute: " + attributeName, element);
=======
throwError("Feature \"" + featureName + "\" does not exists", e);
}
} else if (nodeName.equals(DESCRIPTION)) {
/**
* The method should return without adding any nodes, and traverse deeper into the tree, because description, has no children just return the
* current list. The actual readout of the description happens at a different point.
*/
} else {
throwError("Unknown constraint type: " + nodeName, e);
}
}
return nodes;
}
/**
* Parses the feature order section.
*/
private void parseFeatureOrder(NodeList nodeList) throws UnsupportedModelException {
final ArrayList<String> order = new ArrayList<>(object.getNumberOfFeatures());
for (final Element e : getElements(nodeList)) {
if (e.hasAttributes()) {
final NamedNodeMap nodeMap = e.getAttributes();
for (int i = 0; i < nodeMap.getLength(); i++) {
final org.w3c.dom.Node node = nodeMap.item(i);
final String attributeName = node.getNodeName();
final String attributeValue = node.getNodeValue();
if (attributeName.equals(USER_DEFINED)) {
object.setFeatureOrderUserDefined(attributeValue.equals(TRUE));
} else if (attributeName.equals(NAME)) {
if (object.getFeature(attributeValue) != null) {
order.add(attributeValue);
} else {
throwError("Feature \"" + attributeValue + "\" does not exists", e);
}
} else {
throwError("Unknown feature order attribute: " + attributeName, e);
}
}
}
if (e.hasChildNodes()) {
parseFeatureOrder(e.getChildNodes());
}
}
if (!order.isEmpty()) {
object.setFeatureOrderList(order);
}
}
private void parseFeatures(NodeList nodeList, IFeature parent) throws UnsupportedModelException {
for (final Element e : getElements(nodeList)) {
final String nodeName = e.getNodeName();
if (nodeName.equals(DESCRIPTION)) {
/* case: description */
String nodeValue = e.getFirstChild().getNodeValue();
if ((nodeValue != null) && !nodeValue.isEmpty()) {
nodeValue = nodeValue.replace("\t", "");
nodeValue = nodeValue.substring(1, nodeValue.length() - 1);
nodeValue = nodeValue.trim();
}
parent.getProperty().setDescription(nodeValue);
continue;
}
// Parse the feature attributes
if (nodeName.equals(ATTRIBUTE)) {
if (e.hasAttributes()) {
final NamedNodeMap nodeMapFeatureAttribute = e.getAttributes();
String configurable = null;
String recursive = null;
String name = null;
String unit = null;
String value = null;
String type = null;
for (int i = 0; i < nodeMapFeatureAttribute.getLength(); i++) {
final org.w3c.dom.Node node = nodeMapFeatureAttribute.item(i);
final String attributeName = node.getNodeName();
final String attributeValue = node.getNodeValue();
if (attributeName.equals(ATTRIBUTE_CONFIGURABLE)) {
configurable = attributeValue;
} else if (attributeName.equals(ATTRIBUTE_RECURSIVE)) {
recursive = attributeValue;
} else if (attributeName.equals(NAME)) {
name = attributeValue;
} else if (attributeName.equals(ATTRIBUTE_UNIT)) {
unit = attributeValue;
} else if (attributeName.equals(ATTRIBUTE_VALUE)) {
value = attributeValue;
} else if (attributeName.equals(ATTRIBUTE_TYPE)) {
type = attributeValue;
} else {
throwError("Unknown feature attribute: " + attributeName, e);
}
}
final IFeatureAttributeParsedData parsedAttribute = new FeatureAttributeParsedData(name, type, unit, value, recursive, configurable);
if (parsedAttribute.isRecursed()) {
addLookUpEntry(parent.getName(), name, value);
continue;
}
IFeatureAttribute featureAttribute;
try {
featureAttribute = attributeFactory.createFeatureAttribute(parsedAttribute, parent);
if (featureAttribute != null) {
((ExtendedFeature) parent).addAttribute(featureAttribute);
}
} catch (FeatureAttributeParseException | UnknownFeatureAttributeTypeException e1) {
e1.printStackTrace();
}
>>>>>>>
throwError("Unknown feature attribute: " + attributeName, element); |
<<<<<<<
=======
import org.prop4j.analyses.FeatureModelAnalysis;
>>>>>>>
import org.prop4j.analyses.FeatureModelAnalysis;
<<<<<<<
import de.ovgu.featureide.fm.core.editing.Comparison;
import de.ovgu.featureide.fm.core.editing.ModelComparator;
=======
>>>>>>>
import de.ovgu.featureide.fm.core.editing.Comparison;
import de.ovgu.featureide.fm.core.editing.ModelComparator;
<<<<<<<
=======
import de.ovgu.featureide.fm.core.job.LongRunningWrapper;
import de.ovgu.featureide.fm.core.job.WorkMonitor;
>>>>>>>
import de.ovgu.featureide.fm.core.job.LongRunningWrapper;
import de.ovgu.featureide.fm.core.job.WorkMonitor;
<<<<<<<
private final boolean[] attributeFlags = new boolean[Attribute.values().length];
=======
>>>>>>>
<<<<<<<
private final Collection<IFeature> chachedFalseOptionalFeatures = new LinkedList<>();
=======
private List<IFeature> cachedFalseOptionalFeatures = Collections.emptyList();
>>>>>>>
private List<IFeature> cachedFalseOptionalFeatures = Collections.emptyList();
<<<<<<<
public Collection<IFeature> getCachedFalseOptionalFeatures() {
return chachedFalseOptionalFeatures;
}
=======
>>>>>>>
<<<<<<<
public boolean areMutualExclusive(Collection<IFeature> context, Collection<Set<IFeature>> featureSets) throws TimeoutException {
=======
@Deprecated
public boolean areMutualExclusive(Collection<IFeature> context,
Collection<Set<IFeature>> featureSets) throws TimeoutException {
>>>>>>>
@Deprecated
public boolean areMutualExclusive(Collection<IFeature> context, Collection<Set<IFeature>> featureSets) throws TimeoutException {
<<<<<<<
public boolean mayBeMissing(Collection<IFeature> context, Collection<Set<IFeature>> featureSets) throws TimeoutException {
=======
@Deprecated
public boolean mayBeMissing(Collection<IFeature> context,
Collection<Set<IFeature>> featureSets) throws TimeoutException {
>>>>>>>
@Deprecated
public boolean mayBeMissing(Collection<IFeature> context, Collection<Set<IFeature>> featureSets) throws TimeoutException {
<<<<<<<
=======
@Deprecated
>>>>>>>
@Deprecated
<<<<<<<
public void updateConstraints(HashMap<Object, Object> oldAttributes, HashMap<Object, Object> changedAttributes) {
IFeatureModel clone = fm.clone(null);
clone.setConstraints(new LinkedList<IConstraint>());
SatSolver solver = new SatSolver(NodeCreator.createNodes(clone), 1000);
Collection<IFeature> fmDeadFeatures = new ArrayList<>(getCachedDeadFeatures());
Collection<IFeature> fmFalseOptionals = getCachedFalseOptionalFeatures();
try {
if (!cachedValidity) {
// case: invalid model
boolean contraintFound = false;
for (IConstraint constraint : fm.getConstraints()) {
if (canceled()) {
return;
}
clone.addConstraint(constraint);
try {
if (!contraintFound && !clone.getAnalyser().isValid()) {
if (oldAttributes.get(constraint) != ConstraintAttribute.VOID_MODEL) {
changedAttributes.put(constraint, ConstraintAttribute.VOID_MODEL);
}
contraintFound = true;
constraint.setConstraintAttribute(ConstraintAttribute.VOID_MODEL, false);
}
} catch (TimeoutException e) {
FMCorePlugin.getDefault().logError(e);
}
// contradiction?
SatSolver satsolverUS = new SatSolver(constraint.getNode().clone(), 1000);
try {
if (!satsolverUS.isSatisfiable()) {
if (oldAttributes.get(constraint) != ConstraintAttribute.UNSATISFIABLE) {
changedAttributes.put(constraint, ConstraintAttribute.UNSATISFIABLE);
}
constraint.setConstraintAttribute(ConstraintAttribute.UNSATISFIABLE, false);
}
} catch (TimeoutException e) {
FMCorePlugin.getDefault().logError(e);
}
}
if (monitor != null) {
monitor.done();
}
return;
}
// Default case
/**
* Algorithm description:
* Start from a model without constraints;
* Add one constraint after another;
* Add the NEW introduces errors/warnings to the constraint;
*/
if (calculateRedundantConstraints || calculateTautologyConstraints) {
setSubTask(FIND_REDUNDANT_CONSTRAINTS);
/** Remove redundant constraints for further analysis **/
for (IConstraint constraint : fm.getConstraints()) {
if (canceled()) {
return;
}
if (calculateTautologyConstraints) {
// tautology
SatSolver satsolverTAU = new SatSolver(new Not(constraint.getNode().clone()), 1000);
try {
if (!satsolverTAU.isSatisfiable()) {
if (oldAttributes.get(constraint) != ConstraintAttribute.TAUTOLOGY) {
changedAttributes.put(constraint, ConstraintAttribute.TAUTOLOGY);
}
constraint.setConstraintAttribute(ConstraintAttribute.TAUTOLOGY, false);
worked(1);
continue;
}
} catch (TimeoutException e) {
FMCorePlugin.getDefault().logError(e);
}
}
if (calculateRedundantConstraints) {
findRedundantConstraints(clone, null, constraint, changedAttributes, oldAttributes);
if (changedAttributes.containsKey(constraint)) {
worked(1);
}
}
}
clone = fm.clone(null);
clone.setConstraints(new LinkedList<IConstraint>());
}
/** Look for dead and false optional features **/
for (IConstraint constraint : fm.getConstraints()) {
if (canceled()) {
return;
}
if (changedAttributes.get(constraint) == ConstraintAttribute.TAUTOLOGY) {
continue;
}
if (changedAttributes.get(constraint) == ConstraintAttribute.REDUNDANT) {
continue;
}
constraint.setContainedFeatures();
if (fmFalseOptionals.isEmpty() && fmDeadFeatures.isEmpty()) {
if (constraint.getConstraintAttribute() != ConstraintAttribute.NORMAL) {
constraint.setConstraintAttribute(ConstraintAttribute.NORMAL, false);
changedAttributes.put(constraint, ConstraintAttribute.NORMAL);
}
constraint.setDeadFeatures(Functional.getEmptyIterable(IFeature.class));
constraint.getFalseOptional().clear();
continue;
}
worked(1);
setSubTask(constraint.toString());
clone.addConstraint(constraint);
oldAttributes.put(constraint, constraint.getConstraintAttribute());
constraint.setContainedFeatures();
// if the constraint leads to false optional features it is added to
// changedAttributes in order to refresh graphics later
if (fmFalseOptionals.isEmpty()) {
constraint.getFalseOptional().clear();
} else if (constraint.setFalseOptionalFeatures(clone, fmFalseOptionals)) {
constraint.setConstraintAttribute(ConstraintAttribute.FALSE_OPTIONAL, false);
changedAttributes.put(constraint, ConstraintAttribute.FALSE_OPTIONAL);
// explain false optional features of constraint and remember explanation in map
FalseOptional falseOpts = new FalseOptional();
Collection<IFeature> foFeatures = constraint.getFalseOptional();
for (IFeature feature : foFeatures) {
List<String> expl = falseOpts.explain(clone, feature);
falseOptFeatureExpl.put(feature, expl);
}
}
if (!fmDeadFeatures.isEmpty()) {
Collection<IFeature> deadFeatures = Functional.toList(constraint.getDeadFeatures(solver, clone, fmDeadFeatures));
if (!deadFeatures.isEmpty()) {
fmDeadFeatures.removeAll(deadFeatures);
constraint.setDeadFeatures(deadFeatures);
constraint.setConstraintAttribute(ConstraintAttribute.DEAD, false);
changedAttributes.put(constraint, ConstraintAttribute.DEAD);
// explain dead features of constraint and remember explanation in map
DeadFeatures deadF = new DeadFeatures();
Collection<IFeature> deadfeatures = constraint.getDeadFeatures();
for (IFeature feature : deadfeatures) {
List<String> expl = deadF.explain(clone, feature);
deadFeatureExpl.put(feature, expl);
}
}
} else {
constraint.setDeadFeatures(Collections.<IFeature> emptyList());
}
if (!changedAttributes.containsKey(constraint)) {
constraint.setConstraintAttribute(ConstraintAttribute.NORMAL, false);
changedAttributes.put(constraint, ConstraintAttribute.NORMAL);
}
}
} catch (ConcurrentModificationException e) {
FMCorePlugin.getDefault().logError(e);
}
=======
public void updateConstraints() {
final FeatureModelAnalysis analysis = new FeatureModelAnalysis(fm);
analysis.setCalculateFeatures(false);
analysis.setCalculateConstraints(true);
analysis.setCalculateRedundantConstraints(calculateRedundantConstraints);
analysis.setCalculateTautologyConstraints(calculateTautologyConstraints);
analysis.updateConstraints();
cachedValidity = analysis.isValid();
>>>>>>>
public void updateConstraints() {
final FeatureModelAnalysis analysis = new FeatureModelAnalysis(fm);
analysis.setCalculateFeatures(false);
analysis.setCalculateConstraints(true);
analysis.setCalculateRedundantConstraints(calculateRedundantConstraints);
analysis.setCalculateTautologyConstraints(calculateTautologyConstraints);
analysis.updateConstraints();
cachedValidity = analysis.isValid();
<<<<<<<
/**
* Detects redundancy of a constraint by checking if the model without the new (possibly redundant) constraint
* implies the model with the new constraint and the other way round. If this is the case, both models are
* equivalent and the constraint is redundant.
* If a redundant constraint has been detected, it is explained.
*
* @param clone The feature model with redundant constraint
* @param subModel The sub feature model which represents a sliced feature model of the origin
* feature model (clone). The sub feature model additionally comprises implicit dependencies
* (transitive constraints). An explanation for this model is generated using the origin
* feature model (clone).
* @param constraint The constraint to check whether it is redundant
* @param changedAttributes The changed attributes of a constraint, e.g. REDUNDANT
* @param oldAttributes the old attributes of a constraint, e.g. NORMAL
*/
public void findRedundantConstraints(IFeatureModel clone, IFeatureModel subModel, IConstraint constraint, Map<Object, Object> changedAttributes,
Map<Object, Object> oldAttributes) {
IFeatureModel oldModel = clone.clone(null);
clone.addConstraint(constraint);
ModelComparator comparator = new ModelComparator(500);
Comparison comparison = comparator.compare(clone, oldModel);
if (comparison == Comparison.REFACTORING) {
/*
* Explain redundant constraint. Differentiate between redundancy within a feature model
* and redundancy in a sliced sub feature model when calculating implicit dependencies
*/
Redundancy redundancy = new Redundancy();
if (subModel == null) {
List<String> expl = redundancy.explain(oldModel, clone, constraint); //store explanation for redundant constraint
redundantConstrExpl.put(FeatureUtils.getConstraintIndex(clone, constraint), expl);
} else { // if we are here, we generate an explanation for implicit constraints of a sliced feature model
List<String> expl = redundancy.explain(oldModel, subModel, constraint);
redundantConstrExpl.put(FeatureUtils.getConstraintIndex(subModel, constraint), expl);
}
if (oldAttributes != null && changedAttributes != null) {
if (oldAttributes.get(constraint) != ConstraintAttribute.REDUNDANT) {
changedAttributes.put(constraint, ConstraintAttribute.REDUNDANT);
}
}
constraint.setConstraintAttribute(ConstraintAttribute.REDUNDANT, false);
}
}
public void updateFeatures(Map<Object, Object> oldAttributes, Map<Object, Object> changedAttributes) {
setSubTask(ANALYZE_FEATURES_);
for (IFeature bone : fm.getFeatures()) {
oldAttributes.put(bone, bone.getProperty().getFeatureStatus());
if (bone.getProperty().getFeatureStatus() != FeatureStatus.NORMAL) {
changedAttributes.put(bone, FeatureStatus.FALSE_OPTIONAL);
}
bone.getProperty().setFeatureStatus(FeatureStatus.NORMAL, false);
FeatureUtils.setRelevantConstraints(bone);
}
try {
cachedValidity = isValid();
} catch (TimeoutException e) {
cachedValidity = true;
FMCorePlugin.getDefault().logError(e);
}
try {
if (canceled()) {
return;
}
/**
* here the saved dead features at the feature model are calculated and set
*/
setSubTask(GET_DEAD_FEATURES_);
for (IFeature deadFeature : getDeadFeatures()) {
if (oldAttributes.get(deadFeature) != FeatureStatus.DEAD) {
changedAttributes.put(deadFeature, FeatureStatus.DEAD);
}
deadFeature.getProperty().setFeatureStatus(FeatureStatus.DEAD, false);
}
worked(1);
if (canceled()) {
return;
}
} catch (Exception e) {
FMCorePlugin.getDefault().logError(e);
}
try {
if (cachedValidity) {
setSubTask(GET_FALSE_OPTIONAL_FEATURES_);
getFalseOptionalFeature(oldAttributes, changedAttributes);
worked(1);
}
} catch (Exception e) {
FMCorePlugin.getDefault().logError(e);
}
calculateHidden(changedAttributes);
=======
public void updateFeatures() {
final FeatureModelAnalysis analysis = new FeatureModelAnalysis(fm);
analysis.setCalculateFeatures(true);
analysis.setCalculateConstraints(false);
analysis.updateFeatures();
cachedValidity = analysis.isValid();
cachedCoreFeatures = analysis.getCoreFeatures();
cachedDeadFeatures = analysis.getDeadFeatures();
cachedFalseOptionalFeatures = analysis.getFalseOptionalFeatures();
>>>>>>>
public void updateFeatures() {
final FeatureModelAnalysis analysis = new FeatureModelAnalysis(fm);
analysis.setCalculateFeatures(true);
analysis.setCalculateConstraints(false);
analysis.updateFeatures();
cachedValidity = analysis.isValid();
cachedCoreFeatures = analysis.getCoreFeatures();
cachedDeadFeatures = analysis.getDeadFeatures();
cachedFalseOptionalFeatures = analysis.getFalseOptionalFeatures();
<<<<<<<
private void getFalseOptionalFeature(Map<Object, Object> oldAttributes, Map<Object, Object> changedAttributes) {
chachedFalseOptionalFeatures.clear();
for (IFeature f : getFalseOptionalFeatures()) {
changedAttributes.put(f, FeatureStatus.FALSE_OPTIONAL);
f.getProperty().setFeatureStatus(FeatureStatus.FALSE_OPTIONAL, false);
chachedFalseOptionalFeatures.add(f);
}
}
=======
>>>>>>>
<<<<<<<
public boolean getAttributeFlag(Attribute attribute) {
return attributeFlags[attribute.ordinal()];
}
public void setAttributeFlag(Attribute attribute, boolean flag) {
attributeFlags[attribute.ordinal()] = flag;
}
public void resetAttributeFlags() {
Arrays.fill(attributeFlags, false);
=======
public Collection<IFeature> getCachedFalseOptionalFeatures() {
return Collections.unmodifiableList(cachedFalseOptionalFeatures);
>>>>>>>
public Collection<IFeature> getCachedFalseOptionalFeatures() {
return Collections.unmodifiableList(cachedFalseOptionalFeatures); |
<<<<<<<
import de.ovgu.featureide.fm.core.base.IFeature;
import de.ovgu.featureide.fm.core.base.IFeatureModel;
import de.ovgu.featureide.ui.editors.annotation.ColorPalette;
=======
import de.ovgu.featureide.fm.core.Feature;
import de.ovgu.featureide.fm.core.FeatureModel;
import de.ovgu.featureide.fm.core.color.ColorPalette;
import de.ovgu.featureide.fm.core.color.FeatureColor;
import de.ovgu.featureide.fm.core.color.FeatureColorManager;
>>>>>>>
import de.ovgu.featureide.fm.core.base.IFeature;
import de.ovgu.featureide.fm.core.base.IFeatureModel;
import de.ovgu.featureide.fm.core.color.ColorPalette;
import de.ovgu.featureide.fm.core.color.FeatureColor;
import de.ovgu.featureide.fm.core.color.FeatureColorManager;
<<<<<<<
protected boolean action(IFeatureModel fm, String collName) {
IFeature feat = fm.getFeature(collName);
if (feat != null) {
if (feat.getGraphicRepresenation().getColorList().getColor() != index) {
feat.getGraphicRepresenation().getColorList().setColor(index);
} else {
feat.getGraphicRepresenation().getColorList().removeColor();
}
=======
protected boolean action(FeatureModel fm, String collName) {
Feature feature = fm.getFeature(collName);
if (feature != null) {
FeatureColorManager.setColor(feature, FeatureColor.getColor(index));
>>>>>>>
protected boolean action(IFeatureModel fm, String collName) {
IFeature feature = fm.getFeature(collName);
if (feature != null) {
FeatureColorManager.setColor(feature, FeatureColor.getColor(index)); |
<<<<<<<
public static final String SELECT_SUBTREE = "Select Subtree (CTRL + T)";
=======
public static final String PLEASE_SELECT_A_FEATURE_IN_THE_FEATURE_DIAGRAM = "Please select a feature in the feature diagram";
>>>>>>>
public static final String SELECT_SUBTREE = "Select Subtree (CTRL + T)";
public static final String PLEASE_SELECT_A_FEATURE_IN_THE_FEATURE_DIAGRAM = "Please select a feature in the feature diagram"; |
<<<<<<<
public class AddressUtil {
static public HostAndPort parseAddress(String address) throws NumberFormatException {
return parseAddress(address, false);
=======
public class AddressUtil extends org.apache.accumulo.fate.util.AddressUtil {
static public InetSocketAddress parseAddress(String address, int defaultPort) throws NumberFormatException {
String[] parts = address.split(":", 2);
if (address.contains("+"))
parts = address.split("\\+", 2);
if (parts.length == 2) {
if (parts[1].isEmpty())
return new InetSocketAddress(parts[0], defaultPort);
return new InetSocketAddress(parts[0], Integer.parseInt(parts[1]));
}
return new InetSocketAddress(address, defaultPort);
}
static public InetSocketAddress parseAddress(Text address, int defaultPort) {
return parseAddress(address.toString(), defaultPort);
>>>>>>>
public class AddressUtil extends org.apache.accumulo.fate.util.AddressUtil {
static public HostAndPort parseAddress(String address) throws NumberFormatException {
return parseAddress(address, false); |
<<<<<<<
import de.ovgu.featureide.fm.core.Logger;
=======
import de.ovgu.featureide.fm.core.FeatureModelAnalyzer;
>>>>>>>
<<<<<<<
=======
analyser = oldFeatureModel.getAnalyser() == null ? createAnalyser() : oldFeatureModel.getAnalyser().clone(this);
>>>>>>>
<<<<<<<
public void addListener(IEventListener listener) {
if (!listenerList.contains(listener)) {
listenerList.add(listener);
}
}
@Override
public ArrayList<IEventListener> getListenerList() {
return listenerList;
=======
public IFeatureModel clone(IFeature newRoot) {
return new FeatureModel(this, newRoot);
>>>>>>>
public List<IEventListener> getListenerList() {
return eventManager.getListeners(); |
<<<<<<<
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.StructuredSelection;
=======
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.SelectionChangedEvent;
>>>>>>>
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.SelectionChangedEvent;
<<<<<<<
=======
>>>>>>> |
<<<<<<<
import de.ovgu.featureide.fm.core.base.IFeatureModel;
import de.ovgu.featureide.fm.core.base.event.FeatureIDEEvent;
import de.ovgu.featureide.fm.core.base.event.IEventListener;
import de.ovgu.featureide.fm.core.color.FeatureColorManager;
=======
import de.ovgu.featureide.fm.core.base.IFeature;
import de.ovgu.featureide.fm.core.base.event.FeatureIDEEvent;
import de.ovgu.featureide.fm.core.base.event.FeatureIDEEvent.EventType;
>>>>>>>
import de.ovgu.featureide.fm.core.base.IFeatureModel;
import de.ovgu.featureide.fm.core.base.event.FeatureIDEEvent;
import de.ovgu.featureide.fm.core.base.event.IEventListener;
import de.ovgu.featureide.fm.core.color.FeatureColorManager;
import de.ovgu.featureide.fm.core.base.IFeature;
import de.ovgu.featureide.fm.core.base.event.FeatureIDEEvent.EventType;
<<<<<<<
if ("xml".equalsIgnoreCase(iFile.getFileExtension()) || active_editor instanceof FeatureModelEditor) {
=======
if ("xml".equalsIgnoreCase(iFile.getFileExtension()) && active_editor instanceof FeatureModelEditor) {
//Remove and add again else it will create a sync loop
viewer.removeTreeListener(treeListener);
>>>>>>>
if ("xml".equalsIgnoreCase(iFile.getFileExtension()) && active_editor instanceof FeatureModelEditor) {
//Remove and add again else it will create a sync loop
viewer.removeTreeListener(treeListener);
<<<<<<<
=======
viewer.addTreeListener(treeListener);
if (viewer.getContentProvider() instanceof FmTreeContentProvider) {
((FmTreeContentProvider) viewer.getContentProvider()).setGraphicalFeatureModel(((FeatureModelEditor) active_editor).diagramEditor.getGraphicalFeatureModel());
treeListener.setGraphicalFeatureModel(((FeatureModelEditor) active_editor).diagramEditor.getGraphicalFeatureModel());
if (syncCollapsedFeaturesToggle) {
FmTreeContentProvider contentProvider = (FmTreeContentProvider) viewer.getContentProvider();
ArrayList<Object> expandedElements = new ArrayList<>();
for (IFeature f : contentProvider.getFeatureModel().getFeatures()) {
if (f.getStructure().hasChildren() && !contentProvider.getGraphicalFeatureModel().getGraphicalFeature(f).isCollapsed())
expandedElements.add(f);
}
expandedElements.add("Constraints");
viewer.setExpandedElements(expandedElements.toArray());
}
}
syncCollapsedFeatures.setEnabled(true);
>>>>>>>
viewer.addTreeListener(treeListener);
if (viewer.getContentProvider() instanceof FmTreeContentProvider) {
((FmTreeContentProvider) viewer.getContentProvider()).setGraphicalFeatureModel(((FeatureModelEditor) active_editor).diagramEditor.getGraphicalFeatureModel());
treeListener.setGraphicalFeatureModel(((FeatureModelEditor) active_editor).diagramEditor.getGraphicalFeatureModel());
if (syncCollapsedFeaturesToggle) {
FmTreeContentProvider contentProvider = (FmTreeContentProvider) viewer.getContentProvider();
ArrayList<Object> expandedElements = new ArrayList<>();
for (IFeature f : contentProvider.getFeatureModel().getFeatures()) {
if (f.getStructure().hasChildren() && !contentProvider.getGraphicalFeatureModel().getGraphicalFeature(f).isCollapsed())
expandedElements.add(f);
}
expandedElements.add("Constraints");
viewer.setExpandedElements(expandedElements.toArray());
}
}
syncCollapsedFeatures.setEnabled(true); |
<<<<<<<
=======
// TODO _interfaces: unnecessary with new configuration file format
// if (hasFeatureOrder && configFolder.exists()) {
// try {
// for (IResource res : configFolder.members()) {
// updateConfigurationOrder(res);
// }
// } catch (CoreException e) {
// FMUIPlugin.getDefault().logError(e);
// }
// }
>>>>>>>
<<<<<<<
final IProject project = input.getAdapter(IFile.class).getProject();
=======
// Cast is necessary, don't remove
final IProject project = ((IFile) input.getAdapter(IFile.class)).getProject();
>>>>>>>
// Cast is necessary, don't remove
final IProject project = input.getAdapter(IFile.class).getProject();
<<<<<<<
featureModelEditor.getFeatureModel().setFeatureOrderList(Collections.<String>emptyList());
for (final String featureName : featureModelEditor.getFeatureModel().getFeatureOrderList()) {
=======
featureModelEditor.getFeatureModel().setFeatureOrderList(Collections.<String> emptyList());
for (final String featureName : featureModelEditor.getFeatureModel().getFeatureOrderList()) {
>>>>>>>
featureModelEditor.getFeatureModel().setFeatureOrderList(Collections.<String> emptyList());
for (final String featureName : featureModelEditor.getFeatureModel().getFeatureOrderList()) {
<<<<<<<
File file = input.getAdapter(IFile.class).getProject().getLocation().toFile();
=======
// Cast is necessary, don't remove
File file = ((IFile) input.getAdapter(IFile.class)).getProject().getLocation().toFile();
>>>>>>>
// Cast is necessary, don't remove
File file = input.getAdapter(IFile.class).getProject().getLocation().toFile();
<<<<<<<
=======
// TODO _interfaces: unnecessary with new configuration file format
// /**
// * Renames the features of the given configuration file and <br>
// * synchronizes the order with the feature model.
// *
// * @param resource
// * The configuration file to update
// */
// private void updateConfigurationOrder(IResource resource) {
// if (!(resource instanceof IFile)) {
// return;
// }
// final IFile res = (IFile) resource;
//
// final Configuration config = new Configuration(featureModelEditor.getFeatureModel(), Configuration.PARAM_LAZY);
// try {
// new ConfigurationReader(config).readFromFile(res);
// new ConfigurationWriter(config).saveToFile(res);
// } catch (CoreException | IOException e) {
// FMCorePlugin.getDefault().logError(e);
// }
// }
>>>>>>> |
<<<<<<<
/**
* @param label Description of this operation to be used in the menu
* @param feature feature on which this operation will be executed
*
*/
public SetSiblingsToCollapsedOperation(String featureName, IGraphicalFeatureModel graphicalFeatureModel) {
super(graphicalFeatureModel, COLLAPSE_SIBLINGS);
this.featureName = featureName;
=======
public SetSiblingsToCollapsedOperation(IFeature feature, IGraphicalFeatureModel graphicalFeatureModel) {
super(graphicalFeatureModel.getFeatureModel(), getLabel(feature));
this.feature = feature;
this.graphicalFeatureModel = graphicalFeatureModel;
}
private static String getLabel(IFeature feature) {
return COLLAPSE_SIBLINGS;
>>>>>>>
public SetSiblingsToCollapsedOperation(String featureName, IGraphicalFeatureModel graphicalFeatureModel) {
super(graphicalFeatureModel, COLLAPSE_SIBLINGS);
this.featureName = featureName; |
<<<<<<<
import de.ovgu.featureide.fm.core.filter.ConcreteFeatureFilter;
import de.ovgu.featureide.fm.core.filter.base.Filter;
import de.ovgu.featureide.fm.core.functional.Functional;
=======
import de.ovgu.featureide.fm.core.configuration.SelectableFeature;
import de.ovgu.featureide.fm.core.configuration.Selection;
>>>>>>>
import de.ovgu.featureide.fm.core.filter.ConcreteFeatureFilter;
import de.ovgu.featureide.fm.core.filter.base.Filter;
import de.ovgu.featureide.fm.core.functional.Functional;
<<<<<<<
public QuickFixFalseOptionalFeaturesTest(IFeatureModel fm, String s)
throws UnsupportedModelException {
=======
public QuickFixFalseOptionalFeaturesTest(FeatureModel fm, String s) throws UnsupportedModelException {
>>>>>>>
public QuickFixFalseOptionalFeaturesTest(IFeatureModel fm, String s) throws UnsupportedModelException {
<<<<<<<
final Collection<IFeature> concrete = Filter.retain(new LinkedList<>(Functional.toList(fm.getFeatures())), new ConcreteFeatureFilter());
final Collection<IFeature> core = fm.getAnalyser().getCoreFeatures();
=======
final Collection<Feature> concrete = fm.getConcreteFeatures();
final Collection<Feature> core = fm.getAnalyser().getCoreFeatures();
final Collection<Feature> dead = fm.getAnalyser().getDeadFeatures();
>>>>>>>
final Collection<IFeature> concrete = Filter.retain(new LinkedList<>(Functional.toList(fm.getFeatures())), new ConcreteFeatureFilter());
final Collection<IFeature> core = fm.getAnalyser().getCoreFeatures();
final Collection<IFeature> dead = fm.getAnalyser().getDeadFeatures();
<<<<<<<
for (IFeature feature : concrete) {
if (!core.contains(feature)) {
=======
for (Feature feature : concrete) {
if (!core.contains(feature) && !dead.contains(feature)) {
>>>>>>>
for (IFeature feature : concrete) {
if (!core.contains(feature) && !dead.contains(feature)) {
<<<<<<<
for (final IFeature feature : conf.getUnSelectedFeatures()) {
falseOptionalFeaturesTest.remove(feature.getName());
=======
for (final SelectableFeature feature : conf.getFeatures()) {
if (feature.getSelection() != Selection.SELECTED) {
falseOptionalFeaturesTest.remove(feature.getName());
}
>>>>>>>
for (final IFeature feature : conf.getUnSelectedFeatures()) {
falseOptionalFeaturesTest.remove(feature.getName()); |
<<<<<<<
import de.ovgu.featureide.fm.core.io.IFeatureModelFormat;
import de.ovgu.featureide.fm.core.io.manager.SimpleFileHandler;
=======
import de.ovgu.featureide.fm.core.io.IPersistentFormat;
import de.ovgu.featureide.fm.core.io.manager.FileHandler;
>>>>>>>
import de.ovgu.featureide.fm.core.io.IPersistentFormat;
import de.ovgu.featureide.fm.core.io.manager.SimpleFileHandler; |
<<<<<<<
import de.ovgu.featureide.fm.core.Feature;
import de.ovgu.featureide.fm.core.FeatureModel;
import de.ovgu.featureide.fm.core.editing.AdvancedNodeCreator;
=======
import de.ovgu.featureide.fm.core.base.FeatureUtils;
import de.ovgu.featureide.fm.core.base.IFeature;
import de.ovgu.featureide.fm.core.base.IFeatureModel;
import de.ovgu.featureide.fm.core.editing.NodeCreator;
import de.ovgu.featureide.fm.core.functional.Functional;
>>>>>>>
import de.ovgu.featureide.fm.core.base.FeatureUtils;
import de.ovgu.featureide.fm.core.base.IFeature;
import de.ovgu.featureide.fm.core.base.IFeatureModel;
import de.ovgu.featureide.fm.core.editing.AdvancedNodeCreator;
import de.ovgu.featureide.fm.core.functional.Functional; |
<<<<<<<
import de.ovgu.featureide.common.Commons;
import de.ovgu.featureide.fm.core.io.manager.FeatureModelManager;
=======
import de.ovgu.featureide.Commons;
>>>>>>>
import de.ovgu.featureide.Commons;
import de.ovgu.featureide.fm.core.io.manager.FeatureModelManager;
<<<<<<<
public void checkFalseOptionals() {
final IFeatureModel model = Commons.loadFeatureModelFromFile("false_optional_test.xml", Commons.FEATURE_MODEL_TESTFEATUREMODELS_PATH_REMOTE,
Commons.FEATURE_MODEL_TESTFEATUREMODELS_PATH_LOCAL_CLASS_PATH);
Assert.assertEquals(3, FeatureModelManager.getAnalyzer(model).getFalseOptionalFeatures().size());
=======
public void checkFalseOptionals() {
final IFeatureModel model = Commons.loadTestFeatureModelFromFile("false_optional_test.xml");
model.getAnalyser().analyzeFeatureModel(null);
Assert.assertEquals(model.getAnalyser().getCachedFalseOptionalFeatures().size(), 3);
>>>>>>>
public void checkFalseOptionals() {
final IFeatureModel model = Commons.loadTestFeatureModelFromFile("false_optional_test.xml");
Assert.assertEquals(3, FeatureModelManager.getAnalyzer(model).getFalseOptionalFeatures().size()); |
<<<<<<<
import de.ovgu.featureide.fm.core.configuration.IConfiguration;
=======
>>>>>>>
<<<<<<<
@Override
public void pageChangeTo(int index) {
final IConfiguration configuration = configurationEditor.getConfiguration();
for (SelectableFeature feature : configuration.getFeatures()) {
if (feature.getAutomatic() == Selection.UNDEFINED && feature.getManual() == Selection.UNSELECTED) {
configuration.setManual(feature, Selection.UNDEFINED);
}
}
super.pageChangeTo(index);
}
=======
// TODO
// @Override
// public void pageChangeTo(int index) {
// if (configurationEditor.hasValidFeatureModel()) {
// final Configuration configuration = configurationEditor.getConfiguration();
// for (SelectableFeature feature : configuration.getFeatures()) {
// if (feature.getAutomatic() == Selection.UNDEFINED && feature.getManual() == Selection.UNSELECTED) {
// configuration.setManual(feature, Selection.UNDEFINED);
// }
// }
// }
// super.pageChangeTo(index);
// }
>>>>>>>
@Override
public void pageChangeTo(int index) {
// final IConfiguration configuration = configurationEditor.getConfiguration();
// for (SelectableFeature feature : configuration.getFeatures()) {
// if (feature.getAutomatic() == Selection.UNDEFINED && feature.getManual() == Selection.UNSELECTED) {
// configuration.setManual(feature, Selection.UNDEFINED);
// }
// }
super.pageChangeTo(index);
} |
<<<<<<<
import de.ovgu.featureide.fm.core.editing.AdvancedNodeCreator;
=======
import de.ovgu.featureide.fm.core.editing.NodeCreator;
import de.ovgu.featureide.fm.core.io.manager.ConfigurationManager;
import de.ovgu.featureide.fm.core.io.manager.FileReader;
>>>>>>>
import de.ovgu.featureide.fm.core.editing.AdvancedNodeCreator;
import de.ovgu.featureide.fm.core.io.manager.ConfigurationManager;
import de.ovgu.featureide.fm.core.io.manager.FileReader; |
<<<<<<<
setDirty();
=======
setDirty(true);
>>>>>>>
setDirty();
<<<<<<<
analyzeFeatureModel();
setDirty();
=======
setDirty(true);
>>>>>>>
setDirty();
<<<<<<<
analyzeFeatureModel();
setDirty();
=======
setDirty(true);
>>>>>>>
setDirty(); |
<<<<<<<
final IFeatureModel fm = FeatureModelManager.load(inputFile.toPath());
try (BufferedWriter print = new BufferedWriter(new FileWriter(outputFile))) {
final NodeWriter nodeWriter = new NodeWriter(Nodes.convert(CNFCreator.createNodes(fm)));
nodeWriter.setSymbols(NodeWriter.javaSymbols);
print.write(nodeWriter.nodeToString());
=======
BufferedWriter print = null;
try {
print = new BufferedWriter(new FileWriter(outputFile));
final IFeatureModel fm = FeatureModelManager.load(inputFile.toPath());
final Node nodes = AdvancedNodeCreator.createCNF(fm);
final StringBuilder cnf = new StringBuilder();
cnf.append(nodes.toString(NodeWriter.javaSymbols));
print.write(cnf.toString());
} catch (final FileNotFoundException e) {
Colligens.getDefault().logError(e);
>>>>>>>
final IFeatureModel fm = FeatureModelManager.load(inputFile.toPath());
try (final BufferedWriter print = new BufferedWriter(new FileWriter(outputFile))) {
final NodeWriter nodeWriter = new NodeWriter(Nodes.convert(CNFCreator.createNodes(fm)));
nodeWriter.setSymbols(NodeWriter.javaSymbols);
print.write(nodeWriter.nodeToString()); |
<<<<<<<
public static void setupProject(final IProject project, String compositionToolID, final String sourcePath, final String configPath,
final String buildPath) {
final IComposerExtensionClass composer = getComposer(compositionToolID);
createProjectStructure(project, sourcePath, configPath, buildPath, composer);
IFeatureModel featureModel = createFeatureModelFile(project);
createConfigFile(project, configPath, featureModel, project.getName().split("[-]")[0] + ".");
if (composer != null) {
ISafeRunnable runnable = new ISafeRunnable() {
public void handleException(Throwable e) {
getDefault().logError(e);
}
=======
public static void setupProject(final IProject project, String compositionToolID, final String sourcePath, final String configPath, final String buildPath, boolean shouldCreateSourceFolder, boolean shouldCreateBuildFolder) {
setupFeatureProject(project, compositionToolID, sourcePath, configPath, buildPath, false, false, shouldCreateSourceFolder, shouldCreateBuildFolder);
IConfigurationElement[] config = Platform.getExtensionRegistry().getConfigurationElementsFor(COMPOSERS_ID);
try {
for (IConfigurationElement e : config) {
if (e.getAttribute("id").equals(compositionToolID)) {
final Object o = e.createExecutableExtension("class");
if (o instanceof IComposerExtensionClass) {
>>>>>>>
public static void setupProject(final IProject project, String compositionToolID, final String sourcePath, final String configPath, final String buildPath,
boolean shouldCreateSourceFolder, boolean shouldCreateBuildFolder) {
final IComposerExtensionClass composer = getComposer(compositionToolID);
setupFeatureProject(project, compositionToolID, sourcePath, configPath, buildPath, false, false, shouldCreateSourceFolder, shouldCreateBuildFolder);
IFeatureModel featureModel = createFeatureModelFile(project);
createConfigFile(project, configPath, featureModel, project.getName().split("[-]")[0] + ".");
if (composer != null) {
ISafeRunnable runnable = new ISafeRunnable() {
public void handleException(Throwable e) {
getDefault().logError(e);
}
<<<<<<<
final String buildPath, boolean addCompiler, boolean addNature) {
final IComposerExtensionClass composer = getComposer(compositionToolID);
=======
final String buildPath, boolean addCompiler, boolean addNature, boolean shouldCreateSourceFolder, boolean shouldCreateBuildFolder) {
createProjectStructure(project, sourcePath, configPath, buildPath, shouldCreateSourceFolder, shouldCreateBuildFolder);
>>>>>>>
final String buildPath, boolean addCompiler, boolean addNature, boolean shouldCreateSourceFolder, boolean shouldCreateBuildFolder) {
final IComposerExtensionClass composer = getComposer(compositionToolID);
<<<<<<<
private static void createProjectStructure(IProject project, String sourcePath, String configPath, String buildPath, IComposerExtensionClass composer) {
=======
private static void createProjectStructure(IProject project, String sourcePath, String configPath, String buildPath, boolean shouldCreateSourceFolder, boolean shouldCreateBuildFolder) {
>>>>>>>
private static void createProjectStructure(IProject project, String sourcePath, String configPath, String buildPath, IComposerExtensionClass composer,
boolean shouldCreateSourceFolder, boolean shouldCreateBuildFolder) {
<<<<<<<
if (!("".equals(buildPath) && "".equals(sourcePath)) && composer.hasSource()) {
=======
if ("".equals(buildPath) && "".equals(sourcePath) && shouldCreateBuildFolder) {
>>>>>>>
if (!("".equals(buildPath) && "".equals(sourcePath)) && shouldCreateBuildFolder && composer.hasSource()) {
<<<<<<<
if (composer.hasSource()) {
createFolder(project, sourcePath);
createFolder(project, buildPath);
}
=======
if (shouldCreateSourceFolder) createFolder(project, sourcePath);
>>>>>>>
if (composer.hasSource()) {
if (shouldCreateSourceFolder) {
createFolder(project, sourcePath);
}
if (shouldCreateBuildFolder) {
createFolder(project, buildPath);
}
}
<<<<<<<
}
private static IFeatureModel createFeatureModelFile(IProject project) {
=======
if (shouldCreateBuildFolder) createFolder(project, buildPath);
>>>>>>>
}
private static IFeatureModel createFeatureModelFile(IProject project) {
<<<<<<<
FileHandler.save(modelPath, featureModel, format);
return featureModel;
}
private static Configuration createConfigFile(IProject project, String configPath, IFeatureModel featureModel, final String configName) {
final XMLConfFormat configFormat = new XMLConfFormat();
final IFile file = project.getFolder(configPath).getFile(configName + configFormat.getSuffix());
final Configuration config = new Configuration(featureModel);
FileHandler.save(Paths.get(file.getLocationURI()), config, configFormat);
return config;
=======
FileHandler.save(modelPath, featureModel, format);
}
>>>>>>>
FileHandler.save(modelPath, featureModel, format);
return featureModel;
}
return null;
}
private static Configuration createConfigFile(IProject project, String configPath, IFeatureModel featureModel, final String configName) {
final XMLConfFormat configFormat = new XMLConfFormat();
final IFile file = project.getFolder(configPath).getFile(configName + configFormat.getSuffix());
final Configuration config = new Configuration(featureModel);
FileHandler.save(Paths.get(file.getLocationURI()), config, configFormat);
return config; |
<<<<<<<
import org.apache.accumulo.core.client.security.tokens.AuthenticationToken.AuthenticationTokenSerializer;
=======
import org.apache.accumulo.core.conf.AccumuloConfiguration;
import org.apache.accumulo.core.conf.SiteConfiguration;
>>>>>>>
import org.apache.accumulo.core.client.security.tokens.AuthenticationToken.AuthenticationTokenSerializer;
import org.apache.accumulo.core.conf.AccumuloConfiguration;
import org.apache.accumulo.core.conf.SiteConfiguration; |
<<<<<<<
import io.github.com.pages.sections.*;
=======
import io.github.com.pages.sections.BasicButtonsSection;
import io.github.com.pages.sections.InputSection;
import io.github.com.pages.sections.CheckboxSection;
import io.github.com.pages.sections.SlideToggleSection;
import io.github.com.pages.sections.ToolbarSection;
import io.github.com.pages.sections.AutocompleteSection;
>>>>>>>
import io.github.com.pages.sections.BasicButtonsSection;
import io.github.com.pages.sections.InputSection;
import io.github.com.pages.sections.CheckboxSection;
import io.github.com.pages.sections.SlideToggleSection;
import io.github.com.pages.sections.ToolbarSection;
import io.github.com.pages.sections.AutocompleteSection;
<<<<<<<
public static ListSection listSection;
public static GridListSection gridListSection;
=======
public static BasicButtonsSection basicButtonsSection;
public static AutocompleteSection autocompleteSection;
>>>>>>>
public static ListSection listSection;
public static GridListSection gridListSection;
public static BasicButtonsSection basicButtonsSection;
public static AutocompleteSection autocompleteSection; |
<<<<<<<
import org.openqa.selenium.By;
import org.openqa.selenium.SearchContext;
import org.openqa.selenium.WebElement;
=======
import com.google.common.primitives.Ints;
import org.apache.commons.lang3.ArrayUtils;
import org.hamcrest.Matcher;
import org.hamcrest.MatcherAssert;
import org.openqa.selenium.*;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Iterator;
>>>>>>>
import com.google.common.primitives.Ints;
import org.apache.commons.lang3.ArrayUtils;
import org.hamcrest.Matcher;
import org.hamcrest.MatcherAssert;
import org.openqa.selenium.*;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Iterator;
<<<<<<<
import static com.epam.jdi.light.settings.JDISettings.ELEMENT;
=======
import static com.epam.jdi.light.settings.WebSettings.logger;
import static com.epam.jdi.tools.EnumUtils.getEnumValue;
import static com.epam.jdi.tools.EnumUtils.getEnumValues;
>>>>>>>
import static com.epam.jdi.light.settings.JDISettings.ELEMENT;
import static com.epam.jdi.light.settings.WebSettings.logger;
import static com.epam.jdi.tools.EnumUtils.getEnumValue;
import static com.epam.jdi.tools.EnumUtils.getEnumValues;
<<<<<<<
protected CacheValue<MapArray<String, MobileUIElement>> map = new CacheValue<>(MapArray::new);
=======
@Override
protected SearchContext getDefaultContext() {
return driver();
}
@Override
public boolean isUseCache() {
return webElements.isUseCache();
}
>>>>>>>
protected SearchContext getDefaultContext() {
return driver();
}
@Override
public boolean isUseCache() {
return webElements.isUseCache();
} |
<<<<<<<
/**
* Base html element
*/
public class HtmlElement extends UIElement implements Text, Button, FileInput, Icon, Image, Link, TextArea,
=======
public class HtmlElement extends UIElement implements Text, Button, FileInput, Icon, Image, Link,
>>>>>>>
/**
* Base html element
*/
public class HtmlElement extends UIElement implements Text, Button, FileInput, Icon, Image, Link, TextArea,
<<<<<<<
/**
* Gets attribute 'alt'
* @return String alt value
*/
public String getAlt() { return getAttribute("alt"); }
/**
* Gets attribute 'src'
* @return String src value
*/
public String getSrc() { return getAttribute("src"); }
/**
* Gets attribute 'height'
* @return String height value
*/
public String getHeight() { return getAttribute("height"); }
/**
* Gets attribute 'width'
* @return String width value
*/
public String getWidth() { return getAttribute("width"); }
/**
* Gets attribute 'href'
* @return String href value
*/
public String getRef() { return getAttribute("href"); }
/**
* Creating a URL
* @return URL with value from getRef()
*/
public URL getUrl() {
try { return new URL(getRef());
=======
@JDIAction
public String alt() { return getAttribute("alt"); }
@JDIAction
public String src() { return getAttribute("src"); }
@JDIAction
public String height() { return getAttribute("height"); }
@JDIAction
public String width() { return getAttribute("width"); }
@JDIAction
public String ref() { return getAttribute("href"); }
@JDIAction
public URL url() {
try { return new URL(ref());
>>>>>>>
/**
* Gets attribute 'alt'
* @return String alt value
*/
@JDIAction
public String alt() { return getAttribute("alt"); }
/**
* Gets attribute 'src'
* @return String src value
*/
@JDIAction
public String src() { return getAttribute("src"); }
/**
* Gets attribute 'height'
* @return String height value
*/
@JDIAction
public String height() { return getAttribute("height"); }
/**
* Gets attribute 'width'
* @return String width value
*/
@JDIAction
public String width() { return getAttribute("width"); }
/**
* Gets attribute 'href'
* @return String href value
*/
@JDIAction
public String ref() { return getAttribute("href"); }
/**
* Creating a URL
* @return URL with value from getRef()
*/
@JDIAction
public URL url() {
try { return new URL(ref());
<<<<<<<
/**
* Gets attribute 'placeholder'
* @return String placeholder value
*/
=======
@JDIAction
>>>>>>>
/**
* Gets attribute 'placeholder'
* @return String placeholder value
*/
@JDIAction
<<<<<<<
/**
* If selected - click to deselect
*/
=======
@JDIAction
>>>>>>>
/**
* If selected - click to deselect
*/
@JDIAction
<<<<<<<
/**
* Gets attribute 'value' from color picker
* @return String color value
*/
=======
@JDIAction
>>>>>>>
/**
* Gets attribute 'value' from color picker
* @return String color value
*/
@JDIAction |
<<<<<<<
if (subtermStart != index - 1 || expr != null)
throw new BadArgumentException("expression needs & or |", new String(expression, Constants.UTF8), index - 1);
=======
if (termStart != index - 1 || expr != null)
throw new BadArgumentException("expression needs & or |", new String(expression, UTF_8), index - 1);
>>>>>>>
if (subtermStart != index - 1 || expr != null)
throw new BadArgumentException("expression needs & or |", new String(expression, UTF_8), index - 1);
<<<<<<<
if (subtermStart != index - 1)
throw new BadArgumentException("expression needs & or |", new String(expression, Constants.UTF8), index - 1);
=======
if (termStart != index - 1)
throw new BadArgumentException("expression needs & or |", new String(expression, UTF_8), index - 1);
>>>>>>>
if (subtermStart != index - 1)
throw new BadArgumentException("expression needs & or |", new String(expression, UTF_8), index - 1);
<<<<<<<
throw new BadArgumentException("unclosed quote", new String(expression, Constants.UTF8), subtermStart);
=======
throw new BadArgumentException("unclosed quote", new String(expression, UTF_8), termStart);
if (termStart + 1 == index)
throw new BadArgumentException("empty term", new String(expression, UTF_8), termStart);
>>>>>>>
throw new BadArgumentException("unclosed quote", new String(expression, UTF_8), subtermStart);
<<<<<<<
if (subtermComplete)
throw new BadArgumentException("expression needs & or |", new String(expression, Constants.UTF8), index - 1);
=======
if (termComplete)
throw new BadArgumentException("expression needs & or |", new String(expression, UTF_8), index - 1);
>>>>>>>
if (subtermComplete)
throw new BadArgumentException("expression needs & or |", new String(expression, UTF_8), index - 1); |
<<<<<<<
/**
* Custom match src attribute and passed condition
* @param condition
*/
public void src(Matcher<String> condition) { assertThat(html.getSrc(), condition); }
/**
* Custom match alt attribute and passed condition
* @param condition
*/
public void alt(Matcher<String> condition) { assertThat(html.getAlt(), condition); }
/**
* Custom match href attribute and passed condition
* @param condition
*/
public void ref(Matcher<String> condition) { assertThat(html.getRef(), condition); }
=======
public void isSelected(Matcher<Boolean> condition) { assertThat(html.isSelected(), condition); }
public void src(Matcher<String> condition) { assertThat(html.src(), condition); }
public void alt(Matcher<String> condition) { assertThat(html.alt(), condition); }
public void ref(Matcher<String> condition) { assertThat(html.ref(), condition); }
>>>>>>>
public void isSelected(Matcher<Boolean> condition) { assertThat(html.isSelected(), condition); }
/**
* Custom match src attribute and passed condition
* @param condition
*/
public void src(Matcher<String> condition) { assertThat(html.src(), condition); }
/**
* Custom match alt attribute and passed condition
* @param condition
*/
public void alt(Matcher<String> condition) { assertThat(html.alt(), condition); }
/**
* Custom match href attribute and passed condition
* @param condition
*/
public void ref(Matcher<String> condition) { assertThat(html.ref(), condition); } |
<<<<<<<
protected SearchContext getDefaultContext() {
=======
private By getFrameLocator(By frame, WebDriver driver) {
try {
driver.findElement(frame).getTagName();
return frame;
} catch (Exception ignore) {
return By.id(getByLocator(frame));
}
}
private SearchContext getDefaultContext() {
>>>>>>>
private By getFrameLocator(By frame, WebDriver driver) {
try {
driver.findElement(frame).getTagName();
return frame;
} catch (Exception ignore) {
return By.id(getByLocator(frame));
}
}
protected SearchContext getDefaultContext() { |
<<<<<<<
import com.epam.jdi.light.elements.base.JDIBase;
import com.epam.jdi.light.ui.html.base.HtmlElement;
=======
import com.epam.jdi.light.elements.base.JDIBase;
>>>>>>>
import com.epam.jdi.light.elements.base.JDIBase;
import com.epam.jdi.light.ui.html.base.HtmlElement;
<<<<<<<
@Test
public void formInitializationTest() {
SoftAssert softAssert = new SoftAssert();
//1 Assert initialized elements are not null
softAssert.assertNotNull(pseudoLoginFormLight);
softAssert.assertNotNull(pseudoLoginForm);
softAssert.assertNotNull(pseudoLoginFormSmart);
softAssert.assertNotNull(pseudoLoginForm.userName);
softAssert.assertNotNull(pseudoLoginForm.userPassword);
softAssert.assertNotNull(pseudoLoginForm.loginButton);
softAssert.assertNotNull(pseudoLoginFormSmart.userName);
softAssert.assertNotNull(pseudoLoginFormSmart.userPassword);
softAssert.assertNotNull(pseudoLoginFormSmart.loginButton);
//2 Assert elements' locators are correct
softAssert.assertEquals(pseudoLoginFormLight.locator.toString(), "");
softAssert.assertEquals(pseudoLoginForm.locator.toString(), "");
softAssert.assertEquals(pseudoLoginFormSmart.locator.toString(), "");
softAssert.assertEquals(((HtmlElement) pseudoLoginForm.userName).locator.toString(), "css='#user-name'");
softAssert.assertEquals(((HtmlElement) pseudoLoginForm.userPassword).locator.toString(), "css='#user-password'");
softAssert.assertEquals(((HtmlElement) pseudoLoginForm.loginButton).locator.toString(), "css='#login-button'");
//3 Assert elements' parents are correct
softAssert.assertEquals(pseudoLoginFormLight.parent, pseudoHeader);
softAssert.assertEquals(pseudoLoginForm.parent, pseudoHeader);
softAssert.assertEquals(pseudoLoginFormSmart.parent, pseudoHeader);
softAssert.assertEquals(((HtmlElement) pseudoLoginForm.userName).parent, pseudoLoginForm);
softAssert.assertEquals(((HtmlElement) pseudoLoginForm.userPassword).parent, pseudoLoginForm);
softAssert.assertEquals(((HtmlElement) pseudoLoginForm.loginButton).parent, pseudoLoginForm);
softAssert.assertEquals(((HtmlElement) pseudoLoginFormSmart.userName).parent, pseudoLoginFormSmart);
softAssert.assertEquals(((HtmlElement) pseudoLoginFormSmart.userPassword).parent, pseudoLoginFormSmart);
softAssert.assertEquals(((HtmlElement) pseudoLoginFormSmart.loginButton).parent, pseudoLoginFormSmart);
//4 Assert elements' names are correct
softAssert.assertEquals(pseudoLoginFormLight.name, "Pseudo Login Form Light");
softAssert.assertEquals(pseudoLoginForm.name, "Pseudo Login Form");
softAssert.assertEquals(pseudoLoginFormSmart.name, "Pseudo Login Form Smart");
softAssert.assertEquals(((HtmlElement) pseudoLoginForm.userName).name, "User Name");
softAssert.assertEquals(((HtmlElement) pseudoLoginForm.userPassword).name, "User Password");
softAssert.assertEquals(((HtmlElement) pseudoLoginForm.loginButton).name, "Login Button");
softAssert.assertEquals(((HtmlElement) pseudoLoginFormSmart.userName).name, "User Name");
softAssert.assertEquals(((HtmlElement) pseudoLoginFormSmart.userPassword).name, "User Password");
softAssert.assertEquals(((HtmlElement) pseudoLoginFormSmart.loginButton).name, "Login Button");
//5
checkInitializedElement((JDIBase) pseudoLoginForm.getFindByWebElement(), "css='#some-id'", pseudoLoginForm, "Find By Web Element");
//6
checkInitializedElement((JDIBase) pseudoLoginForm.getFindByWebElementList(), "css='.some-list-class'", pseudoLoginForm, "Find By Web Element List");
//7
checkInitializedElement(pseudoLoginForm.getFindByUIElement(), "css='.some-class'", pseudoLoginForm, "Find By UI Element");
softAssert.assertAll();
}
@Test
public void loginWithUserTest() {
shouldBeLoggedOut();
loginForm.shouldBeOpened();
loginForm.login(DEFAULT_USER);
homePage.checkOpened();
}
@Test
public void loginWithUserToSmartFormTest() {
shouldBeLoggedOut();
loginFormSmart.shouldBeOpened();
loginFormSmart.login(DEFAULT_USER);
homePage.checkOpened();
}
@Test
public void loginWithUserToLightFormTest() {
shouldBeLoggedOut();
refresh();
userIcon.click();
loginFormLight.login(DEFAULT_USER);
homePage.checkOpened();
}
@Test
public void loginAsTest() {
shouldBeLoggedOut();
loginForm.shouldBeOpened();
loginForm.loginAs(DEFAULT_USER);
homePage.checkOpened();
}
@Test
public void plainLoginTest() {
shouldBeLoggedOut();
loginForm.shouldBeOpened();
loginForm.fill(DEFAULT_USER);
loginForm.login();
homePage.checkOpened();
}
@Test
public void fillContactFormTest() {
shouldBeLoggedIn();
contactFormPage.shouldBeOpened();
refresh();
main.contactForm.fill(DEFAULT_CONTACT);
main.contactForm.check(DEFAULT_CONTACT);
}
@Test
public void submitEntityToContactFormTest() {
shouldBeLoggedIn();
contactFormPage.shouldBeOpened();
refresh();
main.contactForm.submit(DEFAULT_CONTACT);
main.contactForm.check(DEFAULT_CONTACT);
}
@Test
public void submitTextToContactFormTest() {
shouldBeLoggedIn();
contactFormPage.shouldBeOpened();
refresh();
main.contactForm.submit(defaultContactName);
main.contactForm.check(ONLY_NAME_FILLED_DEFAULT_CONTACT);
}
@Test
public void submitEntityToContactFormUsingCustomButtonTest() {
shouldBeLoggedIn();
contactFormPage.shouldBeOpened();
refresh();
main.contactForm.submit(DEFAULT_CONTACT, "custom");
main.contactForm.check(DEFAULT_CONTACT);
}
@Test(expectedExceptions = RuntimeException.class)
public void submitEntityToContactFormUsingNonExistentButtonTest() {
shouldBeLoggedIn();
contactFormPage.shouldBeOpened();
refresh();
TIMEOUT.set(1);
main.contactForm.submit(DEFAULT_CONTACT, "nonExistent");
}
@Test
public void submitTextToContactFormUsingCustomButtonTest() {
shouldBeLoggedIn();
contactFormPage.shouldBeOpened();
refresh();
main.contactForm.submit(defaultContactName, "custom");
main.contactForm.check(ONLY_NAME_FILLED_DEFAULT_CONTACT);
}
@Test(expectedExceptions = RuntimeException.class)
public void submitTextToContactFormUsingNonExistentButtonTest() {
shouldBeLoggedIn();
contactFormPage.shouldBeOpened();
refresh();
TIMEOUT.set(1);
main.contactForm.submit(defaultContactName, "nonExistent");
}
@Test
public void plainSubmitTest() {
shouldBeLoggedIn();
contactFormPage.shouldBeOpened();
refresh();
main.contactForm.fill(DEFAULT_CONTACT);
main.contactForm.submit();
main.contactForm.check(DEFAULT_CONTACT);
}
private void checkInitializedElement(JDIBase htmlElementToCheck, String expectedLocator, JDIBase expectedParent, String expectedName) {
assertNotNull(htmlElementToCheck);
assertEquals(htmlElementToCheck.locator.toString(), expectedLocator);
assertEquals(htmlElementToCheck.parent, expectedParent);
assertEquals(htmlElementToCheck.name, expectedName);
=======
@Test(dataProvider = "formDataProvider", dataProviderClass = FormDataProvider.class)
public void formInitializationTest(JDIBase htmlElementToCheck, String expectedLocator, JDIBase expectedParent, String expectedName) {
checkInitializedElement(htmlElementToCheck, expectedLocator, expectedParent, expectedName);
>>>>>>>
@Test(dataProvider = "formDataProvider", dataProviderClass = FormDataProvider.class)
public void formInitializationTest(JDIBase htmlElementToCheck, String expectedLocator, JDIBase expectedParent, String expectedName) {
checkInitializedElement(htmlElementToCheck, expectedLocator, expectedParent, expectedName);
}
@Test
public void loginWithUserTest() {
shouldBeLoggedOut();
loginForm.shouldBeOpened();
loginForm.login(DEFAULT_USER);
homePage.checkOpened();
}
@Test
public void loginWithUserToSmartFormTest() {
shouldBeLoggedOut();
loginFormSmart.shouldBeOpened();
loginFormSmart.login(DEFAULT_USER);
homePage.checkOpened();
}
@Test
public void loginWithUserToLightFormTest() {
shouldBeLoggedOut();
refresh();
userIcon.click();
loginFormLight.login(DEFAULT_USER);
homePage.checkOpened();
}
@Test
public void loginAsTest() {
shouldBeLoggedOut();
loginForm.shouldBeOpened();
loginForm.loginAs(DEFAULT_USER);
homePage.checkOpened();
}
@Test
public void plainLoginTest() {
shouldBeLoggedOut();
loginForm.shouldBeOpened();
loginForm.fill(DEFAULT_USER);
loginForm.login();
homePage.checkOpened();
}
@Test
public void fillContactFormTest() {
shouldBeLoggedIn();
contactFormPage.shouldBeOpened();
refresh();
main.contactForm.fill(DEFAULT_CONTACT);
main.contactForm.check(DEFAULT_CONTACT);
}
@Test
public void submitEntityToContactFormTest() {
shouldBeLoggedIn();
contactFormPage.shouldBeOpened();
refresh();
main.contactForm.submit(DEFAULT_CONTACT);
main.contactForm.check(DEFAULT_CONTACT);
}
@Test
public void submitTextToContactFormTest() {
shouldBeLoggedIn();
contactFormPage.shouldBeOpened();
refresh();
main.contactForm.submit(defaultContactName);
main.contactForm.check(ONLY_NAME_FILLED_DEFAULT_CONTACT);
}
@Test
public void submitEntityToContactFormUsingCustomButtonTest() {
shouldBeLoggedIn();
contactFormPage.shouldBeOpened();
refresh();
main.contactForm.submit(DEFAULT_CONTACT, "custom");
main.contactForm.check(DEFAULT_CONTACT);
}
@Test(expectedExceptions = RuntimeException.class)
public void submitEntityToContactFormUsingNonExistentButtonTest() {
shouldBeLoggedIn();
contactFormPage.shouldBeOpened();
refresh();
TIMEOUT.set(1);
main.contactForm.submit(DEFAULT_CONTACT, "nonExistent");
}
@Test
public void submitTextToContactFormUsingCustomButtonTest() {
shouldBeLoggedIn();
contactFormPage.shouldBeOpened();
refresh();
main.contactForm.submit(defaultContactName, "custom");
main.contactForm.check(ONLY_NAME_FILLED_DEFAULT_CONTACT);
}
@Test(expectedExceptions = RuntimeException.class)
public void submitTextToContactFormUsingNonExistentButtonTest() {
shouldBeLoggedIn();
contactFormPage.shouldBeOpened();
refresh();
TIMEOUT.set(1);
main.contactForm.submit(defaultContactName, "nonExistent");
}
@Test
public void plainSubmitTest() {
shouldBeLoggedIn();
contactFormPage.shouldBeOpened();
refresh();
main.contactForm.fill(DEFAULT_CONTACT);
main.contactForm.submit();
main.contactForm.check(DEFAULT_CONTACT); |
<<<<<<<
import pseudo.site.pages.Header;
import pseudo.site.section.ExtendedSection;
import pseudo.site.section.CustomSection;
=======
import pseudo.site.pages.*;
import pseudo.site.section.*;
>>>>>>>
import pseudo.site.pages.Header;
import pseudo.site.section.ExtendedSection;
import pseudo.site.section.CustomSection;
import pseudo.site.pages.*; |
<<<<<<<
import static com.epam.jdi.tools.switcher.SwitchActions.*;
=======
import static com.epam.jdi.tools.switcher.SwitchActions.*;
import static com.epam.jdi.tools.switcher.SwitchActions.Switch;
>>>>>>>
import static com.epam.jdi.tools.switcher.SwitchActions.*;
import static com.epam.jdi.tools.switcher.SwitchActions.Switch;
<<<<<<<
private static String getDefaultName(String method, MapArray<String, Object> args) {
if (args.size() == 1 && args.get(0).value.getClass().isArray())
return format("%s(%s)", method, arrayToString(args.get(0).value));
MapArray<String, String> methodArgs = args.toMapArray(Object::toString);
String stringArgs = Switch(methodArgs.size()).get(
Value(0, ""),
Value(1, v->"("+methodArgs.get(0).value+")"),
Default(v->"("+methodArgs.toString()+")")
);
return format("%s%s", method, stringArgs);
=======
static String getActionName(JoinPoint joinPoint) {
try {
MethodSignature method = getMethod(joinPoint);
String template = methodNameTemplate(method);
return Switch(template).get(
Case(t -> t.contains("{0"), t -> MessageFormat.format(t, joinPoint.getArgs())),
Case(t -> t.contains("{"), t -> {
MapArray obj = new MapArray<>("this", getElementName(joinPoint));
return getActionName(method, t, obj, methodArgs(joinPoint, method), classFields(joinPoint));
}),
Case(t -> t.contains("%s"), t -> format(t, joinPoint.getArgs())),
Default(t -> {
MapArray<String, Object> args = methodArgs(joinPoint, method);
if (args.size() == 1 && args.get(0).value.getClass().isArray())
return format("%s(%s)", t, arrayToString(args.get(0).value));
MapArray<String, String> methodArgs = args.toMapArray(Object::toString);
String stringArgs = Switch(methodArgs.size()).get(
Value(0, ""),
Value(1, v->"("+methodArgs.get(0).value+")"),
Default(v->"("+methodArgs.toString()+")")
);
return format("%s%s", t, stringArgs);
})
);
} catch (Exception ex) {
throw new RuntimeException("Surround method issue: " +
"Can't get action name: " + ex.getMessage());
}
>>>>>>>
private static String getDefaultName(String method, MapArray<String, Object> args) {
if (args.size() == 1 && args.get(0).value.getClass().isArray())
return format("%s(%s)", method, arrayToString(args.get(0).value));
MapArray<String, String> methodArgs = args.toMapArray(Object::toString);
String stringArgs = Switch(methodArgs.size()).get(
Value(0, ""),
Value(1, v->"("+methodArgs.get(0).value+")"),
Default(v->"("+methodArgs.toString()+")")
);
return format("%s%s", method, stringArgs);
}
static String getActionName(JoinPoint joinPoint) {
try {
MethodSignature method = getMethod(joinPoint);
String template = methodNameTemplate(method);
return Switch(template).get(
Case(t -> t.contains("{0"), t -> MessageFormat.format(t, joinPoint.getArgs())),
Case(t -> t.contains("{"), t -> {
MapArray obj = new MapArray<>("this", getElementName(joinPoint));
return getActionName(method, t, obj, methodArgs(joinPoint, method), classFields(joinPoint));
}),
Case(t -> t.contains("%s"), t -> format(t, joinPoint.getArgs())),
Default(t -> {
MapArray<String, Object> args = methodArgs(joinPoint, method);
if (args.size() == 1 && args.get(0).value.getClass().isArray())
return format("%s(%s)", t, arrayToString(args.get(0).value));
MapArray<String, String> methodArgs = args.toMapArray(Object::toString);
String stringArgs = Switch(methodArgs.size()).get(
Value(0, ""),
Value(1, v->"("+methodArgs.get(0).value+")"),
Default(v->"("+methodArgs.toString()+")")
);
return format("%s%s", t, stringArgs);
})
);
} catch (Exception ex) {
throw new RuntimeException("Surround method issue: " +
"Can't get action name: " + ex.getMessage());
} |
<<<<<<<
import static com.github.jcgay.maven.notifier.ConfigurationParser.ConfigurationProperties.Property.GROWL_PORT;
import static com.github.jcgay.maven.notifier.ConfigurationParser.ConfigurationProperties.Property.IMPLEMENTATION;
import static com.github.jcgay.maven.notifier.ConfigurationParser.ConfigurationProperties.Property.NOTIFICATION_CENTER_ACTIVATE;
import static com.github.jcgay.maven.notifier.ConfigurationParser.ConfigurationProperties.Property.NOTIFICATION_CENTER_PATH;
import static com.github.jcgay.maven.notifier.ConfigurationParser.ConfigurationProperties.Property.NOTIFICATION_CENTER_SOUND;
import static com.github.jcgay.maven.notifier.ConfigurationParser.ConfigurationProperties.Property.NOTIFY_SEND_PATH;
import static com.github.jcgay.maven.notifier.ConfigurationParser.ConfigurationProperties.Property.NOTIFY_SEND_TIMEOUT;
import static com.github.jcgay.maven.notifier.ConfigurationParser.ConfigurationProperties.Property.SNARL_HOST;
import static com.github.jcgay.maven.notifier.ConfigurationParser.ConfigurationProperties.Property.SNARL_PORT;
import static com.github.jcgay.maven.notifier.ConfigurationParser.ConfigurationProperties.Property.SYSTEM_TRAY_WAIT;
=======
import static com.github.jcgay.maven.notifier.ConfigurationParser.ConfigurationProperties.Property.GROWL_HOST;
import static com.github.jcgay.maven.notifier.ConfigurationParser.ConfigurationProperties.Property.GROWL_PASSWORD;
import static com.github.jcgay.maven.notifier.ConfigurationParser.ConfigurationProperties.Property.GROWL_PORT;
import static com.github.jcgay.maven.notifier.ConfigurationParser.ConfigurationProperties.Property.IMPLEMENTATION;
import static com.github.jcgay.maven.notifier.ConfigurationParser.ConfigurationProperties.Property.NOTIFICATION_CENTER_ACTIVATE;
import static com.github.jcgay.maven.notifier.ConfigurationParser.ConfigurationProperties.Property.NOTIFICATION_CENTER_PATH;
import static com.github.jcgay.maven.notifier.ConfigurationParser.ConfigurationProperties.Property.NOTIFY_SEND_PATH;
import static com.github.jcgay.maven.notifier.ConfigurationParser.ConfigurationProperties.Property.NOTIFY_SEND_TIMEOUT;
import static com.github.jcgay.maven.notifier.ConfigurationParser.ConfigurationProperties.Property.SYSTEM_TRAY_WAIT;
>>>>>>>
import static com.github.jcgay.maven.notifier.ConfigurationParser.ConfigurationProperties.Property.GROWL_HOST;
import static com.github.jcgay.maven.notifier.ConfigurationParser.ConfigurationProperties.Property.GROWL_PASSWORD;
import static com.github.jcgay.maven.notifier.ConfigurationParser.ConfigurationProperties.Property.GROWL_PORT;
import static com.github.jcgay.maven.notifier.ConfigurationParser.ConfigurationProperties.Property.IMPLEMENTATION;
import static com.github.jcgay.maven.notifier.ConfigurationParser.ConfigurationProperties.Property.NOTIFICATION_CENTER_ACTIVATE;
import static com.github.jcgay.maven.notifier.ConfigurationParser.ConfigurationProperties.Property.NOTIFICATION_CENTER_PATH;
import static com.github.jcgay.maven.notifier.ConfigurationParser.ConfigurationProperties.Property.NOTIFICATION_CENTER_SOUND;
import static com.github.jcgay.maven.notifier.ConfigurationParser.ConfigurationProperties.Property.NOTIFY_SEND_PATH;
import static com.github.jcgay.maven.notifier.ConfigurationParser.ConfigurationProperties.Property.NOTIFY_SEND_TIMEOUT;
import static com.github.jcgay.maven.notifier.ConfigurationParser.ConfigurationProperties.Property.SNARL_HOST;
import static com.github.jcgay.maven.notifier.ConfigurationParser.ConfigurationProperties.Property.SNARL_PORT;
import static com.github.jcgay.maven.notifier.ConfigurationParser.ConfigurationProperties.Property.SYSTEM_TRAY_WAIT;
<<<<<<<
configuration.setNotificationCenterSound(properties.get(NOTIFICATION_CENTER_SOUND));
=======
configuration.setGrowlHost(properties.get(GROWL_HOST));
>>>>>>>
configuration.setNotificationCenterSound(properties.get(NOTIFICATION_CENTER_SOUND));
configuration.setGrowlHost(properties.get(GROWL_HOST));
<<<<<<<
SYSTEM_TRAY_WAIT("notifier.system-tray.wait", String.valueOf(TimeUnit.SECONDS.toMillis(2))),
SNARL_PORT("notifier.snarl.port", String.valueOf(9887)),
SNARL_HOST("notifier.snarl.host", "localhost"),
NOTIFICATION_CENTER_SOUND("notifier.notification-center.sound");
=======
GROWL_HOST("notifier.growl.host"),
GROWL_PASSWORD("notifier.growl.password"),
SYSTEM_TRAY_WAIT("notifier.system-tray.wait", String.valueOf(TimeUnit.SECONDS.toMillis(2)));
>>>>>>>
GROWL_HOST("notifier.growl.host"),
GROWL_PASSWORD("notifier.growl.password"),
SYSTEM_TRAY_WAIT("notifier.system-tray.wait", String.valueOf(TimeUnit.SECONDS.toMillis(2))),
SNARL_PORT("notifier.snarl.port", String.valueOf(9887)),
SNARL_HOST("notifier.snarl.host", "localhost"),
NOTIFICATION_CENTER_SOUND("notifier.notification-center.sound"); |
<<<<<<<
import com.google.inject.Inject;
import com.google.inject.Injector;
import com.google.inject.Singleton;
=======
import com.gitblit.utils.XssFilter;
>>>>>>>
import com.gitblit.utils.XssFilter;
import com.google.inject.Inject;
import com.google.inject.Injector;
import com.google.inject.Singleton;
<<<<<<<
@Inject
private Injector injector;
@Inject
public RuntimeManager(IStoredSettings settings) {
this(settings, null);
=======
public RuntimeManager(IStoredSettings settings, XssFilter xssFilter) {
this(settings, xssFilter, null);
>>>>>>>
@Inject
private Injector injector;
@Inject
public RuntimeManager(IStoredSettings settings, XssFilter xssFilter) {
this(settings, xssFilter, null); |
<<<<<<<
=======
import com.gitblit.utils.XssFilter;
import com.gitblit.utils.HttpUtils;
>>>>>>>
import com.gitblit.utils.XssFilter;
import com.gitblit.utils.HttpUtils;
<<<<<<<
@Override
public Injector getInjector() {
return runtimeManager.getInjector();
}
=======
@Override
public XssFilter getXssFilter() {
return runtimeManager.getXssFilter();
}
>>>>>>>
@Override
public Injector getInjector() {
return runtimeManager.getInjector();
}
@Override
public XssFilter getXssFilter() {
return runtimeManager.getXssFilter();
} |
<<<<<<<
import eu.europa.esig.dss.pades.validation.suite.DSS2023Test;
import eu.europa.esig.dss.pades.validation.suite.DSS818Test;
import eu.europa.esig.dss.pades.validation.suite.DSS917Test;
import eu.europa.esig.dss.pades.validation.suite.DiagnosticDataCompleteTest;
import eu.europa.esig.dss.pades.validation.suite.EtsiValidationReportCompleteTest;
import eu.europa.esig.dss.pades.validation.suite.PAdESCorruptedSigTest;
=======
>>>>>>>
import eu.europa.esig.dss.pades.validation.suite.DSS2023Test;
<<<<<<<
@SelectClasses({ ASN1PolicyTest.class, DSS1188Test.class, DSS1376GetOriginalDocTest.class, DSS1420Test.class,
DSS818Test.class, DSS917Test.class, PadesWrongDigestAlgoTest.class, PdfPkcs7Test.class, DSS1443Test.class,
DSS1538Test.class, DSS1683Test.class, DSS1690Test.class, DiagnosticDataCompleteTest.class,
EtsiValidationReportCompleteTest.class, SignatureTimestampCertificateNotFoundTest.class,
PAdESCorruptedSigTest.class, PAdESNonLatinCharactersValidationTest.class, ArchiveTimestampCoverageTest.class,
PolicyZeroHashTest.class, SIWATest.class, DSS1794Test.class, PAdESMultipleFieldSignatureReferenceTest.class,
DSS1899Test.class, PAdESInfiniteLoopTest.class, PAdESTimestampWithOrphanRefsTest.class, DSS1972Test.class,
BadEncodedCMSTest.class, PAdESWithOrphanOcspCertRefsTest.class, DSS1983Test.class, DSS2023Test.class })
=======
@SelectClasses({ ASN1PolicyTest.class, DSS1188Test.class, DSS1376GetOriginalDocTest.class, DSS1420Test.class, DSS1420Sha224Test.class,
DSS818CRYTest.class, DSS818ADOTest.class, DSS818SKTest.class, DSS917Test.class, DSS917CorruptedTest.class, PadesWrongDigestAlgoTest.class,
PdfPkcs7Test.class, DSS1538Test.class, DSS1683Test.class, DSS1690Test.class, PAdESRevocationOriginTest.class, PAdESMultiSignedDocRevocTest.class,
PAdESDssAndVriTest.class, PAdESFiveSignaturesDocTest.class, PAdESSignatureDigestReferenceTest.class, PAdESSignatureDigestReferenceTest.class,
SignatureTimestampCertificateNotFoundTest.class, PAdESSimpleValidationTest.class, PAdESSimpleCorruptedTest.class, PAdESOutOfByteRangeTest.class,
ArchiveTimestampCoverageTest.class, DoubleArchiveTstCoverageTest.class, PolicyZeroHashTest.class, SIWATest.class, DSS1794CrlTest.class,
DSS1794OcspTest.class, PAdESMultipleFieldSignatureReferenceTest.class, DSS1899Test.class, DSS1899TstWithNullTypeTest.class, PAdESInfiniteLoopTest.class,
PAdESTimestampWithOrphanRefsTest.class, DSS1972Test.class, BadEncodedCMSTest.class, PAdESWithOrphanOcspCertRefsTest.class, DSS1983Test.class,
DSS1469Test.class, DSS1469LTTest.class, PAdESOCSPSigningCertificateTest.class, PAdESWithDssVriAndCertRefTest.class,
PAdESOrphanOcspFromDssRevisionTest.class, PAdESInvalidDigestAlgorithmTest.class })
>>>>>>>
@SelectClasses({ ASN1PolicyTest.class, DSS1188Test.class, DSS1376GetOriginalDocTest.class, DSS1420Test.class, DSS1420Sha224Test.class,
DSS818CRYTest.class, DSS818ADOTest.class, DSS818SKTest.class, DSS917Test.class, DSS917CorruptedTest.class, PadesWrongDigestAlgoTest.class,
PdfPkcs7Test.class, DSS1538Test.class, DSS1683Test.class, DSS1690Test.class, PAdESRevocationOriginTest.class, PAdESMultiSignedDocRevocTest.class,
PAdESDssAndVriTest.class, PAdESFiveSignaturesDocTest.class, PAdESSignatureDigestReferenceTest.class, PAdESSignatureDigestReferenceTest.class,
SignatureTimestampCertificateNotFoundTest.class, PAdESSimpleValidationTest.class, PAdESSimpleCorruptedTest.class, PAdESOutOfByteRangeTest.class,
ArchiveTimestampCoverageTest.class, DoubleArchiveTstCoverageTest.class, PolicyZeroHashTest.class, SIWATest.class, DSS1794CrlTest.class,
DSS1794OcspTest.class, PAdESMultipleFieldSignatureReferenceTest.class, DSS1899Test.class, DSS1899TstWithNullTypeTest.class, PAdESInfiniteLoopTest.class,
PAdESTimestampWithOrphanRefsTest.class, DSS1972Test.class, BadEncodedCMSTest.class, PAdESWithOrphanOcspCertRefsTest.class, DSS1983Test.class,
DSS1469Test.class, DSS1469LTTest.class, PAdESOCSPSigningCertificateTest.class, PAdESWithDssVriAndCertRefTest.class,
PAdESOrphanOcspFromDssRevisionTest.class, PAdESInvalidDigestAlgorithmTest.class, DSS2023Test.class }) |
<<<<<<<
import eu.europa.esig.dss.xades.definition.xades132.XAdES132Paths;
=======
import eu.europa.esig.dss.xades.reference.DSSReference;
import eu.europa.esig.dss.xades.reference.DSSTransform;
import eu.europa.esig.dss.xades.reference.ReferenceOutputType;
>>>>>>>
import eu.europa.esig.dss.xades.definition.xades132.XAdES132Paths;
import eu.europa.esig.dss.xades.reference.DSSReference;
import eu.europa.esig.dss.xades.reference.DSSTransform;
import eu.europa.esig.dss.xades.reference.ReferenceOutputType;
<<<<<<<
/**
* Creates and returns a counter signature found in the {@code counterSignatureElement}
*
* @param counterSignatureElement {@link Element} {@code <ds:CounterSignature>} element
* @param masterSignature {@link XAdESSignature} master signature containing the counter signature
* @return
*/
public static XAdESSignature createCounterSignature(Element counterSignatureElement, XAdESSignature masterSignature) {
try {
/*
* 5.2.7.2 Enveloped countersignatures: the CounterSignature qualifying property
*
* The CounterSignature qualifying property shall contain one countersignature
* of the XAdES signature where CounterSignature is incorporated.
*/
final Node counterSignatureNode = DomUtils.getNode(counterSignatureElement, XMLDSigPaths.SIGNATURE_PATH);
// Verify that the element is a proper signature by trying to build a XAdESSignature out of it
final XAdESSignature xadesCounterSignature = new XAdESSignature((Element) counterSignatureNode, masterSignature.getXAdESPathsHolders());
xadesCounterSignature.setSignatureFilename(masterSignature.getSignatureFilename());
xadesCounterSignature.setDetachedContents(masterSignature.getDetachedContents());
if (isCounterSignature(xadesCounterSignature)) {
xadesCounterSignature.setMasterSignature(masterSignature);
return xadesCounterSignature;
}
} catch (Exception e) {
String errorMessage = "An error occurred during counter signature extraction. The element entry is skipped. Reason : {}";
if (LOG.isDebugEnabled()) {
LOG.warn(errorMessage, e.getMessage(), e);
} else {
LOG.warn(errorMessage, e.getMessage());
}
}
return null;
}
/**
* This method verifies whether a given signature is a countersignature.
*
* From ETSI TS 101 903 V1.4.2: - The signature's ds:SignedInfo element MUST contain one ds:Reference element
* referencing the ds:Signature element of the
* embedding and countersigned XAdES signature - The content of the ds:DigestValue in the aforementioned
* ds:Reference element of the countersignature MUST
* be the base-64 encoded digest of the complete (and canonicalized) ds:SignatureValue element (i.e. including the
* starting and closing tags) of the
* embedding and countersigned XAdES signature.
*
* @param xadesCounterSignature {@link XAdESSignature} a signature extracted from {@code <ds:CounterSignature>} element
* @return TRUE if the current XAdES Signature contains a coutner signature reference, FALSE otherwise
*/
private static boolean isCounterSignature(final XAdESSignature xadesCounterSignature) {
final List<Reference> references = xadesCounterSignature.getReferences();
for (final Reference reference : references) {
if (DSSXMLUtils.isCounterSignature(reference, xadesCounterSignature.getXAdESPaths())) {
return true;
}
}
return false;
}
/**
* Returns a NodeList of all "ds:Signature" elements found in the
* {@code documentNode}
*
* @param documentNode {@link Node} the XML document or its part
* @return {@link NodeList}
*/
public static NodeList getAllSignaturesExceptCounterSignatures(Node documentNode) {
return DomUtils.getNodeList(documentNode, XAdES132Paths.ALL_SIGNATURE_WITH_NO_COUNTERSIGNATURE_AS_PARENT_PATH);
}
/**
* Returns a NodeList of "ds:Reference" elements
*
* @param signatureElement {@link Node} representing a ds:Signature node
* @return {@link NodeList}
*/
public static NodeList getReferenceNodeList(Node signatureElement) {
return DomUtils.getNodeList(signatureElement, XMLDSigPaths.SIGNED_INFO_REFERENCE_PATH);
}
=======
/**
* Returns the expected dereferencing output for the provided {@code DSSReference}
*
* @param reference {@link DSSReference} to get OutputType for
* @return {@link ReferenceOutputType}
*/
public static ReferenceOutputType getReferenceOutputType(final DSSReference reference) {
ReferenceOutputType outputType = getDereferenceOutputType(reference.getUri());
if (Utils.isCollectionNotEmpty(reference.getTransforms())) {
for (DSSTransform transform : reference.getTransforms()) {
String algorithmUri = transform.getAlgorithm();
outputType = getTransformOutputType(algorithmUri);
}
}
return outputType;
}
/**
* Returns the expected dereferencing output for the provided {@code Reference}
*
* @param reference {@link Reference} to get OutputType for
* @return {@link ReferenceOutputType}
*/
public static ReferenceOutputType getReferenceOutputType(final Reference reference) throws XMLSecurityException {
ReferenceOutputType outputType = getDereferenceOutputType(reference.getURI());
Transforms transforms = reference.getTransforms();
if (transforms != null) {
for (int ii = 0; ii < transforms.getLength(); ii++) {
Transform transform = transforms.item(ii);
outputType = getTransformOutputType(transform.getURI());
}
}
return outputType;
}
private static ReferenceOutputType getDereferenceOutputType(String referenceUri) {
return isSameDocumentReference(referenceUri) ? ReferenceOutputType.NODE_SET : ReferenceOutputType.OCTET_STREAM;
}
private static ReferenceOutputType getTransformOutputType(String algorithmUri) {
return transformsWithNodeSetOutput.contains(algorithmUri) ? ReferenceOutputType.NODE_SET : ReferenceOutputType.OCTET_STREAM;
}
>>>>>>>
/**
* Creates and returns a counter signature found in the {@code counterSignatureElement}
*
* @param counterSignatureElement {@link Element} {@code <ds:CounterSignature>} element
* @param masterSignature {@link XAdESSignature} master signature containing the counter signature
* @return
*/
public static XAdESSignature createCounterSignature(Element counterSignatureElement, XAdESSignature masterSignature) {
try {
/*
* 5.2.7.2 Enveloped countersignatures: the CounterSignature qualifying property
*
* The CounterSignature qualifying property shall contain one countersignature
* of the XAdES signature where CounterSignature is incorporated.
*/
final Node counterSignatureNode = DomUtils.getNode(counterSignatureElement, XMLDSigPaths.SIGNATURE_PATH);
// Verify that the element is a proper signature by trying to build a XAdESSignature out of it
final XAdESSignature xadesCounterSignature = new XAdESSignature((Element) counterSignatureNode, masterSignature.getXAdESPathsHolders());
xadesCounterSignature.setSignatureFilename(masterSignature.getSignatureFilename());
xadesCounterSignature.setDetachedContents(masterSignature.getDetachedContents());
if (isCounterSignature(xadesCounterSignature)) {
xadesCounterSignature.setMasterSignature(masterSignature);
return xadesCounterSignature;
}
} catch (Exception e) {
String errorMessage = "An error occurred during counter signature extraction. The element entry is skipped. Reason : {}";
if (LOG.isDebugEnabled()) {
LOG.warn(errorMessage, e.getMessage(), e);
} else {
LOG.warn(errorMessage, e.getMessage());
}
}
return null;
}
/**
* This method verifies whether a given signature is a countersignature.
*
* From ETSI TS 101 903 V1.4.2: - The signature's ds:SignedInfo element MUST contain one ds:Reference element
* referencing the ds:Signature element of the
* embedding and countersigned XAdES signature - The content of the ds:DigestValue in the aforementioned
* ds:Reference element of the countersignature MUST
* be the base-64 encoded digest of the complete (and canonicalized) ds:SignatureValue element (i.e. including the
* starting and closing tags) of the
* embedding and countersigned XAdES signature.
*
* @param xadesCounterSignature {@link XAdESSignature} a signature extracted from {@code <ds:CounterSignature>} element
* @return TRUE if the current XAdES Signature contains a coutner signature reference, FALSE otherwise
*/
private static boolean isCounterSignature(final XAdESSignature xadesCounterSignature) {
final List<Reference> references = xadesCounterSignature.getReferences();
for (final Reference reference : references) {
if (DSSXMLUtils.isCounterSignature(reference, xadesCounterSignature.getXAdESPaths())) {
return true;
}
}
return false;
}
/**
* Returns a NodeList of all "ds:Signature" elements found in the
* {@code documentNode}
*
* @param documentNode {@link Node} the XML document or its part
* @return {@link NodeList}
*/
public static NodeList getAllSignaturesExceptCounterSignatures(Node documentNode) {
return DomUtils.getNodeList(documentNode, XAdES132Paths.ALL_SIGNATURE_WITH_NO_COUNTERSIGNATURE_AS_PARENT_PATH);
}
/**
* Returns a NodeList of "ds:Reference" elements
*
* @param signatureElement {@link Node} representing a ds:Signature node
* @return {@link NodeList}
*/
public static NodeList getReferenceNodeList(Node signatureElement) {
return DomUtils.getNodeList(signatureElement, XMLDSigPaths.SIGNED_INFO_REFERENCE_PATH);
}
/**
* Returns the expected dereferencing output for the provided
* {@code DSSReference}
*
* @param reference {@link DSSReference} to get OutputType for
* @return {@link ReferenceOutputType}
*/
public static ReferenceOutputType getReferenceOutputType(final DSSReference reference) {
ReferenceOutputType outputType = getDereferenceOutputType(reference.getUri());
if (Utils.isCollectionNotEmpty(reference.getTransforms())) {
for (DSSTransform transform : reference.getTransforms()) {
String algorithmUri = transform.getAlgorithm();
outputType = getTransformOutputType(algorithmUri);
}
}
return outputType;
}
/**
* Returns the expected dereferencing output for the provided {@code Reference}
*
* @param reference {@link Reference} to get OutputType for
* @return {@link ReferenceOutputType}
*/
public static ReferenceOutputType getReferenceOutputType(final Reference reference) throws XMLSecurityException {
ReferenceOutputType outputType = getDereferenceOutputType(reference.getURI());
Transforms transforms = reference.getTransforms();
if (transforms != null) {
for (int ii = 0; ii < transforms.getLength(); ii++) {
Transform transform = transforms.item(ii);
outputType = getTransformOutputType(transform.getURI());
}
}
return outputType;
}
private static ReferenceOutputType getDereferenceOutputType(String referenceUri) {
return isSameDocumentReference(referenceUri) ? ReferenceOutputType.NODE_SET : ReferenceOutputType.OCTET_STREAM;
}
private static ReferenceOutputType getTransformOutputType(String algorithmUri) {
return transformsWithNodeSetOutput.contains(algorithmUri) ? ReferenceOutputType.NODE_SET : ReferenceOutputType.OCTET_STREAM;
} |
<<<<<<<
systemPreferredVolumes = v1.toString() + "," + v2.toString();
siteConfig.put(PreferredVolumeChooser.TABLE_PREFERRED_VOLUMES, systemPreferredVolumes); // exclude v4
cfg.setSiteConfig(siteConfig);
siteConfig.put(PerTableVolumeChooser.getPropertyNameForScope(ChooserScope.LOGGER), PreferredVolumeChooser.class.getName());
siteConfig.put(PreferredVolumeChooser.getPropertyNameForScope(ChooserScope.LOGGER), v2.toString());
cfg.setSiteConfig(siteConfig);
// Only add volumes 1, 2, and 4 to the list of instance volumes to have one volume that isn't in the options list when they are choosing
cfg.setProperty(Property.INSTANCE_VOLUMES, v1.toString() + "," + v2.toString() + "," + v4.toString());
=======
// Only add volumes 1, 2, and 4 to the list of instance volumes to have one volume that isn't in
// the options list when they are choosing
cfg.setProperty(Property.INSTANCE_VOLUMES,
v1.toString() + "," + v2.toString() + "," + v4.toString());
>>>>>>>
systemPreferredVolumes = v1.toString() + "," + v2.toString();
siteConfig.put(PreferredVolumeChooser.TABLE_PREFERRED_VOLUMES, systemPreferredVolumes); // exclude
// v4
cfg.setSiteConfig(siteConfig);
siteConfig.put(PerTableVolumeChooser.getPropertyNameForScope(ChooserScope.LOGGER),
PreferredVolumeChooser.class.getName());
siteConfig.put(PreferredVolumeChooser.getPropertyNameForScope(ChooserScope.LOGGER),
v2.toString());
cfg.setSiteConfig(siteConfig);
// Only add volumes 1, 2, and 4 to the list of instance volumes to have one volume that isn't in
// the options list when they are choosing
cfg.setProperty(Property.INSTANCE_VOLUMES,
v1.toString() + "," + v2.toString() + "," + v4.toString());
<<<<<<<
public static void addSplits(Connector connector, String tableName) throws TableNotFoundException, AccumuloException, AccumuloSecurityException {
=======
public void addSplits(Connector connector, String tableName)
throws TableNotFoundException, AccumuloException, AccumuloSecurityException {
>>>>>>>
public static void addSplits(Connector connector, String tableName)
throws TableNotFoundException, AccumuloException, AccumuloSecurityException {
<<<<<<<
public static void writeAndReadData(Connector connector, String tableName) throws Exception {
writeDataToTable(connector, tableName);
// Write the data to disk, read it back
connector.tableOperations().flush(tableName, null, null, true);
try (Scanner scanner = connector.createScanner(tableName, Authorizations.EMPTY)) {
int i = 0;
for (Entry<Key,Value> entry : scanner) {
assertEquals("Data read is not data written", rows[i++], entry.getKey().getRow().toString());
}
}
}
public static void writeDataToTable(Connector connector, String tableName) throws Exception {
=======
public void writeAndReadData(Connector connector, String tableName)
throws AccumuloException, AccumuloSecurityException, TableNotFoundException {
>>>>>>>
public static void writeAndReadData(Connector connector, String tableName) throws Exception {
writeDataToTable(connector, tableName);
// Write the data to disk, read it back
connector.tableOperations().flush(tableName, null, null, true);
try (Scanner scanner = connector.createScanner(tableName, Authorizations.EMPTY)) {
int i = 0;
for (Entry<Key,Value> entry : scanner) {
assertEquals("Data read is not data written", rows[i++],
entry.getKey().getRow().toString());
}
}
}
public static void writeDataToTable(Connector connector, String tableName) throws Exception {
<<<<<<<
private void configureNamespace(Connector connector, String volumeChooserClassName, String configuredVolumes, String namespace) throws Exception {
connector.namespaceOperations().create(namespace);
// Set properties on the namespace
connector.namespaceOperations().setProperty(namespace, PerTableVolumeChooser.TABLE_VOLUME_CHOOSER, volumeChooserClassName);
connector.namespaceOperations().setProperty(namespace, PreferredVolumeChooser.TABLE_PREFERRED_VOLUMES, configuredVolumes);
}
private void verifyVolumesForWritesToNewTable(Connector connector, String myNamespace, String expectedVolumes) throws Exception {
String tableName = myNamespace + ".1";
connector.tableOperations().create(tableName);
Table.ID tableID = Table.ID.of(connector.tableOperations().tableIdMap().get(tableName));
// Add 10 splits to the table
addSplits(connector, tableName);
// Write some data to the table
writeAndReadData(connector, tableName);
// Verify the new files are written to the Volumes specified
verifyVolumes(connector, tableName, TabletsSection.getRange(tableID), expectedVolumes);
}
public static void verifyWaLogVolumes(Connector connector, Range tableRange, String vol) throws TableNotFoundException {
=======
public void verifyVolumes(Connector connector, String tableName, Range tableRange, String vol)
throws TableNotFoundException {
>>>>>>>
private void configureNamespace(Connector connector, String volumeChooserClassName,
String configuredVolumes, String namespace) throws Exception {
connector.namespaceOperations().create(namespace);
// Set properties on the namespace
connector.namespaceOperations().setProperty(namespace,
PerTableVolumeChooser.TABLE_VOLUME_CHOOSER, volumeChooserClassName);
connector.namespaceOperations().setProperty(namespace,
PreferredVolumeChooser.TABLE_PREFERRED_VOLUMES, configuredVolumes);
}
private void verifyVolumesForWritesToNewTable(Connector connector, String myNamespace,
String expectedVolumes) throws Exception {
String tableName = myNamespace + ".1";
connector.tableOperations().create(tableName);
Table.ID tableID = Table.ID.of(connector.tableOperations().tableIdMap().get(tableName));
// Add 10 splits to the table
addSplits(connector, tableName);
// Write some data to the table
writeAndReadData(connector, tableName);
// Verify the new files are written to the Volumes specified
verifyVolumes(connector, tableName, TabletsSection.getRange(tableID), expectedVolumes);
}
public static void verifyWaLogVolumes(Connector connector, Range tableRange, String vol)
throws TableNotFoundException {
<<<<<<<
VolumeChooserIT.addSplits(connector, tableName);
VolumeChooserIT.writeDataToTable(connector, tableName);
// should only go to v2 as per configuration in configure()
VolumeChooserIT.verifyWaLogVolumes(connector, new Range(), v2.toString());
=======
// Add 10 splits to the table
addSplits(connector, tableName);
// Write some data to the table
writeAndReadData(connector, tableName);
// Verify the new files are written to the Volumes specified
verifyVolumes(connector, tableName, TabletsSection.getRange(tableID),
v1.toString() + "," + v2.toString() + "," + v4.toString());
>>>>>>>
VolumeChooserIT.addSplits(connector, tableName);
VolumeChooserIT.writeDataToTable(connector, tableName);
// should only go to v2 as per configuration in configure()
VolumeChooserIT.verifyWaLogVolumes(connector, new Range(), v2.toString()); |
<<<<<<<
import eu.europa.esig.dss.enumerations.CommitmentType;
=======
import eu.europa.esig.dss.enumerations.CertificateRefOrigin;
import eu.europa.esig.dss.enumerations.CertificateSourceType;
>>>>>>>
import eu.europa.esig.dss.enumerations.CertificateRefOrigin;
import eu.europa.esig.dss.enumerations.CertificateSourceType;
import eu.europa.esig.dss.enumerations.CommitmentType; |
<<<<<<<
import org.apache.commons.io.IOUtils;
=======
import org.apache.commons.collections.CollectionUtils;
>>>>>>>
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.io.IOUtils; |
<<<<<<<
final X509Certificate x509Certificate = chainCertificate.getX509Certificate();
if (trustAnchorBPPolicy && (certificatePool != null)) {
=======
final CertificateToken x509Certificate = chainCertificate.getX509Certificate();
if (trustAnchorBPPolicy && certificatePool != null) {
>>>>>>>
final CertificateToken x509Certificate = chainCertificate.getX509Certificate();
if (trustAnchorBPPolicy && (certificatePool != null)) {
<<<<<<<
final byte[] encoded = DSSUtils.getEncoded(x509Certificate);
final String base64Encoded = Base64.encodeBase64String(encoded);
=======
final byte[] encoded = x509Certificate.getEncoded();
final String base64Encoded = DSSUtils.base64Encode(encoded);
>>>>>>>
final byte[] encoded = x509Certificate.getEncoded();
final String base64Encoded = Base64.encodeBase64String(encoded); |
<<<<<<<
import java.util.HashMap;
=======
import java.util.Date;
>>>>>>>
import java.util.Date;
import java.util.HashMap;
<<<<<<<
import eu.europa.esig.dss.spi.tsl.LOTLInfo;
import eu.europa.esig.dss.spi.tsl.TLInfo;
import eu.europa.esig.dss.spi.tsl.TLValidationJobSummary;
import eu.europa.esig.dss.spi.tsl.TrustProperties;
=======
import eu.europa.esig.dss.spi.tsl.TrustProperties;
>>>>>>>
import eu.europa.esig.dss.spi.tsl.LOTLInfo;
import eu.europa.esig.dss.spi.tsl.TLInfo;
import eu.europa.esig.dss.spi.tsl.TLValidationJobSummary;
import eu.europa.esig.dss.spi.tsl.TrustProperties;
<<<<<<<
import eu.europa.esig.dss.spi.tsl.dto.TrustServiceProvider;
import eu.europa.esig.dss.spi.util.TimeDependentValues;
=======
import eu.europa.esig.dss.spi.tsl.dto.TrustServiceProvider;
import eu.europa.esig.dss.spi.tsl.dto.TrustServiceStatusAndInformationExtensions;
import eu.europa.esig.dss.spi.tsl.dto.TrustServiceStatusAndInformationExtensions.TrustServiceStatusAndInformationExtensionsBuilder;
import eu.europa.esig.dss.spi.util.TimeDependentValues;
>>>>>>>
import eu.europa.esig.dss.spi.tsl.dto.TrustServiceProvider;
import eu.europa.esig.dss.spi.tsl.dto.TrustServiceStatusAndInformationExtensions;
import eu.europa.esig.dss.spi.tsl.dto.TrustServiceStatusAndInformationExtensions.TrustServiceStatusAndInformationExtensionsBuilder;
import eu.europa.esig.dss.spi.util.TimeDependentValues;
<<<<<<<
trustedCertSource.setSummary(new TLValidationJobSummary(new ArrayList<LOTLInfo>(), new ArrayList<TLInfo>()));
TrustProperties trustProperties = new TrustProperties("BE.xml", new TrustServiceProvider(), new TimeDependentValues<>());
HashMap<CertificateToken, List<TrustProperties>> hashMap = new HashMap<CertificateToken, List<TrustProperties>>();
hashMap.put(rootToken, Arrays.asList(trustProperties));
trustedCertSource.setTrustPropertiesByCertificates(hashMap);
=======
TrustServiceProvider trustServiceProvider = new TrustServiceProvider();
TrustServiceStatusAndInformationExtensionsBuilder builder = new TrustServiceStatusAndInformationExtensionsBuilder();
builder.setStatus("bla");
builder.setType("bla");
builder.setStartDate(new Date());
TrustServiceStatusAndInformationExtensions serviceStatus = new TrustServiceStatusAndInformationExtensions(builder);
Iterable<TrustServiceStatusAndInformationExtensions> srcList = Arrays.<TrustServiceStatusAndInformationExtensions>asList(serviceStatus);
TimeDependentValues<TrustServiceStatusAndInformationExtensions> status = new TimeDependentValues<TrustServiceStatusAndInformationExtensions>(
srcList);
TrustProperties trustService = new TrustProperties("aaaa", "bbb", trustServiceProvider, status);
trustedCertSource.addCertificate(rootToken, trustService);
>>>>>>>
trustedCertSource.setSummary(new TLValidationJobSummary(new ArrayList<LOTLInfo>(), new ArrayList<TLInfo>()));
TrustServiceProvider trustServiceProvider = new TrustServiceProvider();
TrustServiceStatusAndInformationExtensionsBuilder builder = new TrustServiceStatusAndInformationExtensionsBuilder();
builder.setStatus("bla");
builder.setType("bla");
builder.setStartDate(new Date());
TrustServiceStatusAndInformationExtensions serviceStatus = new TrustServiceStatusAndInformationExtensions(builder);
Iterable<TrustServiceStatusAndInformationExtensions> srcList = Arrays.<TrustServiceStatusAndInformationExtensions>asList(serviceStatus);
TimeDependentValues<TrustServiceStatusAndInformationExtensions> status = new TimeDependentValues<TrustServiceStatusAndInformationExtensions>(
srcList);
TrustProperties trustProperties = new TrustProperties("aaaa", "bbb", trustServiceProvider, status);
HashMap<CertificateToken, List<TrustProperties>> hashMap = new HashMap<CertificateToken, List<TrustProperties>>();
hashMap.put(rootToken, Arrays.asList(trustProperties));
trustedCertSource.setTrustPropertiesByCertificates(hashMap); |
<<<<<<<
import org.apache.commons.lang.StringUtils;
=======
>>>>>>>
<<<<<<<
serviceTypeStr = StringUtils.trim(trustedServiceProvider.getTSPServiceType());
Date statusStartDate = trustedServiceProvider.getStartDate();
if (processValueCheck(serviceTypeStr) && statusStartDate != null) {
Date statusEndDate = trustedServiceProvider.getEndDate();
// The issuing time of the certificate should be into the validity period of the associated
// service
if ((usageTime.compareTo(statusStartDate) >= 0) && ((statusEndDate == null) || usageTime.before(statusEndDate))) {
return true;
=======
XmlServiceStatus serviceStatus = trustedServiceProvider.getServiceStatus();
if (serviceStatus != null && Utils.isCollectionNotEmpty(serviceStatus.getStatusService())) {
for (XmlServiceStatusType status : serviceStatus.getStatusService()) {
serviceTypeStr = Utils.trim(trustedServiceProvider.getTSPServiceType());
if (processValueCheck(serviceTypeStr)) {
Date statusStartDate = status.getStartDate();
Date statusEndDate = status.getEndDate();
// The issuing time of the certificate should be into the validity period of the associated
// service
if ((usageTime.compareTo(statusStartDate) >= 0) && ((statusEndDate == null) || usageTime.before(statusEndDate))) {
return true;
}
}
>>>>>>>
serviceTypeStr = Utils.trim(trustedServiceProvider.getTSPServiceType());
Date statusStartDate = trustedServiceProvider.getStartDate();
if (processValueCheck(serviceTypeStr) && statusStartDate != null) {
Date statusEndDate = trustedServiceProvider.getEndDate();
// The issuing time of the certificate should be into the validity period of the associated
// service
if ((usageTime.compareTo(statusStartDate) >= 0) && ((statusEndDate == null) || usageTime.before(statusEndDate))) {
return true; |
<<<<<<<
private String passwordProtection;
=======
private List<PdfRevision> documentRevisions;
>>>>>>>
private List<PdfRevision> documentRevisions;
private String passwordProtection;
<<<<<<<
/**
* Specify the used password for the encrypted document
* @param pwd the used password
*/
public void setPasswordProtection(String pwd) {
this.passwordProtection = pwd;
}
=======
@Override
protected DiagnosticDataBuilder prepareDiagnosticDataBuilder(final ValidationContext validationContext) {
List<AdvancedSignature> allSignatures = getAllSignatures();
List<TimestampToken> detachedTimestamps = getDetachedTimestamps();
List<PdfDssDict> dssDictionaries = getDssDictionaries();
ListCRLSource listCRLSource = mergeCRLSources(allSignatures, detachedTimestamps, dssDictionaries);
ListOCSPSource listOCSPSource = mergeOCSPSources(allSignatures, detachedTimestamps, dssDictionaries);
prepareCertificateVerifier(listCRLSource, listOCSPSource);
prepareSignatureValidationContext(validationContext, allSignatures);
prepareDetachedTimestampValidationContext(validationContext, detachedTimestamps);
populateFromDssDictionaries(validationContext, dssDictionaries);
if (!skipValidationContextExecution) {
validateContext(validationContext);
}
return getDiagnosticDataBuilderConfiguration(validationContext, allSignatures, listCRLSource, listOCSPSource);
}
protected ListCRLSource mergeCRLSources(Collection<AdvancedSignature> allSignatures, Collection<TimestampToken> timestampTokens,
Collection<PdfDssDict> dssDictionaries) {
ListCRLSource listCRLSource = mergeCRLSources(allSignatures, timestampTokens);
if (Utils.isCollectionNotEmpty(dssDictionaries)) {
for (PdfDssDict dssDictionary : dssDictionaries) {
listCRLSource.add(new PAdESCRLSource(dssDictionary));
}
}
return listCRLSource;
}
protected ListOCSPSource mergeOCSPSources(Collection<AdvancedSignature> allSignatures, Collection<TimestampToken> timestampTokens,
Collection<PdfDssDict> dssDictionaries) {
ListOCSPSource listOCSPSource = mergeOCSPSources(allSignatures, timestampTokens);
if (Utils.isCollectionNotEmpty(dssDictionaries)) {
for (PdfDssDict dssDictionary : dssDictionaries) {
listOCSPSource.add(new PAdESOCSPSource(dssDictionary));
}
}
return listOCSPSource;
}
protected void populateFromDssDictionaries(final ValidationContext validationContext, List<PdfDssDict> dssDicts) {
for (PdfDssDict dssDict : dssDicts) {
for (CertificateToken certificateToken : dssDict.getCERTs().values()) {
validationContext.addCertificateTokenForVerification(certificateToken);
}
}
}
>>>>>>>
/**
* Specify the used password for the encrypted document
* @param pwd the used password
*/
public void setPasswordProtection(String pwd) {
this.passwordProtection = pwd;
}
@Override
protected DiagnosticDataBuilder prepareDiagnosticDataBuilder(final ValidationContext validationContext) {
List<AdvancedSignature> allSignatures = getAllSignatures();
List<TimestampToken> detachedTimestamps = getDetachedTimestamps();
List<PdfDssDict> dssDictionaries = getDssDictionaries();
ListCRLSource listCRLSource = mergeCRLSources(allSignatures, detachedTimestamps, dssDictionaries);
ListOCSPSource listOCSPSource = mergeOCSPSources(allSignatures, detachedTimestamps, dssDictionaries);
prepareCertificateVerifier(listCRLSource, listOCSPSource);
prepareSignatureValidationContext(validationContext, allSignatures);
prepareDetachedTimestampValidationContext(validationContext, detachedTimestamps);
populateFromDssDictionaries(validationContext, dssDictionaries);
if (!skipValidationContextExecution) {
validateContext(validationContext);
}
return getDiagnosticDataBuilderConfiguration(validationContext, allSignatures, listCRLSource, listOCSPSource);
}
protected ListCRLSource mergeCRLSources(Collection<AdvancedSignature> allSignatures, Collection<TimestampToken> timestampTokens,
Collection<PdfDssDict> dssDictionaries) {
ListCRLSource listCRLSource = mergeCRLSources(allSignatures, timestampTokens);
if (Utils.isCollectionNotEmpty(dssDictionaries)) {
for (PdfDssDict dssDictionary : dssDictionaries) {
listCRLSource.add(new PAdESCRLSource(dssDictionary));
}
}
return listCRLSource;
}
protected ListOCSPSource mergeOCSPSources(Collection<AdvancedSignature> allSignatures, Collection<TimestampToken> timestampTokens,
Collection<PdfDssDict> dssDictionaries) {
ListOCSPSource listOCSPSource = mergeOCSPSources(allSignatures, timestampTokens);
if (Utils.isCollectionNotEmpty(dssDictionaries)) {
for (PdfDssDict dssDictionary : dssDictionaries) {
listOCSPSource.add(new PAdESOCSPSource(dssDictionary));
}
}
return listOCSPSource;
}
protected void populateFromDssDictionaries(final ValidationContext validationContext, List<PdfDssDict> dssDicts) {
for (PdfDssDict dssDict : dssDicts) {
for (CertificateToken certificateToken : dssDict.getCERTs().values()) {
validationContext.addCertificateTokenForVerification(certificateToken);
}
}
}
<<<<<<<
PDFSignatureService pdfSignatureService = pdfObjectFactory.newPAdESSignatureService();
pdfSignatureService.setPasswordProtection(passwordProtection);
pdfSignatureService.validateSignatures(validationCertPool, document, new PdfSignatureValidationCallback() {
@Override
public void validate(final PdfSignatureRevision pdfSignatureRevision) {
=======
for (PdfRevision pdfRevision : getRevisions()) {
if (pdfRevision instanceof PdfSignatureRevision) {
PdfSignatureRevision pdfSignatureRevision = (PdfSignatureRevision) pdfRevision;
>>>>>>>
for (PdfRevision pdfRevision : getRevisions()) {
if (pdfRevision instanceof PdfSignatureRevision) {
PdfSignatureRevision pdfSignatureRevision = (PdfSignatureRevision) pdfRevision;
<<<<<<<
PDFSignatureService pdfSignatureService = pdfObjectFactory.newPAdESSignatureService();
pdfSignatureService.setPasswordProtection(passwordProtection);
pdfSignatureService.validateSignatures(validationCertPool, document, new PdfTimestampValidationCallback() {
@Override
public void validate(PdfDocTimestampRevision pdfDocTimestampRevision) {
=======
for (PdfRevision pdfRevision : getRevisions()) {
if (pdfRevision instanceof PdfDocTimestampRevision) {
PdfDocTimestampRevision pdfDocTimestampRevision = (PdfDocTimestampRevision) pdfRevision;
>>>>>>>
for (PdfRevision pdfRevision : getRevisions()) {
if (pdfRevision instanceof PdfDocTimestampRevision) {
PdfDocTimestampRevision pdfDocTimestampRevision = (PdfDocTimestampRevision) pdfRevision; |
<<<<<<<
* The reference to the object containing all candidates to the signing certificate.
*/
protected CandidatesForSigningCertificate candidatesForSigningCertificate;
/**
* The default constructor with mandatory certificates pool.
*
* @param certPool the certificate pool
*/
protected SignatureCertificateSource(final CertificatePool certPool) {
super(certPool);
}
/**
=======
>>>>>>>
* The reference to the object containing all candidates to the signing
* certificate.
*/
protected CandidatesForSigningCertificate candidatesForSigningCertificate;
/** |
<<<<<<<
super(Transforms.TRANSFORM_XPATH2FILTER, xPathExpression);
Objects.requireNonNull(filter, "filter cannot be null!");
=======
this(XAdESNamespaces.XMLDSIG, xPathExpression, filter);
}
public XPath2FilterTransform(DSSNamespace xmlDSigNamespace, String xPathExpression, String filter) {
super(xmlDSigNamespace, Transforms.TRANSFORM_XPATH2FILTER, xPathExpression);
>>>>>>>
this(XAdESNamespaces.XMLDSIG, xPathExpression, filter);
}
public XPath2FilterTransform(DSSNamespace xmlDSigNamespace, String xPathExpression, String filter) {
super(xmlDSigNamespace, Transforms.TRANSFORM_XPATH2FILTER, xPathExpression);
Objects.requireNonNull(filter, "filter cannot be null!"); |
<<<<<<<
import eu.europa.esig.dss.spi.x509.CertificatePool;
=======
import eu.europa.esig.dss.spi.x509.CertificateRef;
import eu.europa.esig.dss.spi.x509.CertificateTokenRefMatcher;
>>>>>>>
<<<<<<<
=======
public CandidatesForSigningCertificate getCandidatesForSigningCertificate() {
if (candidatesForSigningCertificate != null) {
return candidatesForSigningCertificate;
}
candidatesForSigningCertificate = new CandidatesForSigningCertificate();
/**
* 5.1.4.1 XAdES processing<br>
* <i>Candidates for the signing certificate extracted from ds:KeyInfo
* element</i> shall be checked against all references present in the
* ds:SigningCertificate property, if present, since one of these references
* shall be a reference to the signing certificate.
*/
final SignatureCertificateSource certSource = getCertificateSource();
for (final CertificateToken certificateToken : certSource.getKeyInfoCertificates()) {
candidatesForSigningCertificate.add(new CertificateValidity(certificateToken));
}
// if KeyInfo does not contain certificates,
// check other certificates embedded into the signature
if (candidatesForSigningCertificate.isEmpty()) {
PublicKey publicKey = getSigningCertificatePublicKey();
if (publicKey != null) {
// try to find out the signing certificate token by provided public key
Set<CertificateToken> certsFromSources = getCompleteCertificateSource().getByPublicKey(publicKey);
if (Utils.isCollectionNotEmpty(certsFromSources)) {
for (CertificateToken certificateToken : certsFromSources) {
candidatesForSigningCertificate.add(new CertificateValidity(certificateToken));
}
} else {
// process public key only if no certificates found
candidatesForSigningCertificate.add(new CertificateValidity(publicKey));
}
} else {
// Add all found certificates
for (CertificateToken certificateToken : certSource.getCertificates()) {
candidatesForSigningCertificate.add(new CertificateValidity(certificateToken));
}
}
}
if (providedSigningCertificateToken != null) {
candidatesForSigningCertificate.add(new CertificateValidity(providedSigningCertificateToken));
}
return candidatesForSigningCertificate;
}
@Override
public void checkSigningCertificate() {
final CandidatesForSigningCertificate candidates = getCandidatesForSigningCertificate();
final List<CertificateRef> potentialSigningCertificates = getCertificateSource().getSigningCertificateRefs();
if (Utils.isCollectionNotEmpty(potentialSigningCertificates)) {
// must contain only one reference
final CertificateRef signingCert = potentialSigningCertificates.get(0);
CertificateTokenRefMatcher matcher = new CertificateTokenRefMatcher();
CertificateValidity bestCertificateValidity = null;
final List<CertificateValidity> certificateValidityList = candidates.getCertificateValidityList();
for (final CertificateValidity certificateValidity : certificateValidityList) {
if (matcher.match(certificateValidity.getCertificateToken(), signingCert)) {
bestCertificateValidity = certificateValidity;
break;
}
}
if (bestCertificateValidity == null) {
// none of them match
bestCertificateValidity = candidates.getCertificateValidityList().iterator().next();
}
bestCertificateValidity.setAttributePresent(signingCert != null);
bestCertificateValidity.setDigestPresent(signingCert.getCertDigest() != null);
CertificateToken bestToken = bestCertificateValidity.getCertificateToken();
if (bestToken != null) {
bestCertificateValidity.setDigestEqual(matcher.matchByDigest(bestToken, signingCert));
bestCertificateValidity.setSerialNumberEqual(matcher.matchBySerialNumber(bestToken, signingCert));
bestCertificateValidity.setDistinguishedNameEqual(matcher.matchByIssuerName(bestToken, signingCert));
}
candidates.setTheCertificateValidity(bestCertificateValidity);
}
}
@Override
>>>>>>> |
<<<<<<<
List<Object> cSigObjects = DSSJsonUtils.getUnsignedProperties(jws, JAdESHeaderParameterNames.C_SIG);
if (Utils.isCollectionNotEmpty(cSigObjects)) {
for (Object cSigObject : cSigObjects) {
JAdESSignature counterSignature = DSSJsonUtils.extractJAdESCounterSignature(cSigObject, this);
if (counterSignature != null) {
counterSignature.setSignatureFilename(getSignatureFilename());
counterSignatures.add(counterSignature);
=======
List<EtsiUComponent> etsiUComponents = getEtsiUHeader().getAttributes();
if (Utils.isCollectionNotEmpty(etsiUComponents)) {
for (EtsiUComponent etsiUComponent : etsiUComponents) {
if (JAdESHeaderParameterNames.C_SIG.equals(etsiUComponent.getHeaderName())) {
JAdESSignature counterSignature = DSSJsonUtils.extractJAdESCounterSignature(etsiUComponent, this);
if (counterSignature != null) {
counterSignature.setSignatureFilename(getSignatureFilename());
countersignatures.add(counterSignature);
}
>>>>>>>
List<EtsiUComponent> etsiUComponents = getEtsiUHeader().getAttributes();
if (Utils.isCollectionNotEmpty(etsiUComponents)) {
for (EtsiUComponent etsiUComponent : etsiUComponents) {
if (JAdESHeaderParameterNames.C_SIG.equals(etsiUComponent.getHeaderName())) {
JAdESSignature counterSignature = DSSJsonUtils.extractJAdESCounterSignature(etsiUComponent, this);
if (counterSignature != null) {
counterSignature.setSignatureFilename(getSignatureFilename());
counterSignatures.add(counterSignature);
} |
<<<<<<<
String o = options.get(NUM_SCANS_STRING_NAME);
if (o != null && !NumberUtils.isNumber(o))
throw new IllegalArgumentException("bad integer " + NUM_SCANS_STRING_NAME + ":" + options.get(NUM_SCANS_STRING_NAME));
=======
try {
String o = options.get(NUM_SCANS_STRING_NAME);
if (o != null)
Integer.parseInt(o);
} catch (Exception e) {
throw new IllegalArgumentException(
"bad integer " + NUM_SCANS_STRING_NAME + ":" + options.get(NUM_SCANS_STRING_NAME), e);
}
>>>>>>>
String o = options.get(NUM_SCANS_STRING_NAME);
if (o != null && !NumberUtils.isNumber(o))
throw new IllegalArgumentException(
"bad integer " + NUM_SCANS_STRING_NAME + ":" + options.get(NUM_SCANS_STRING_NAME)); |
<<<<<<<
=======
import java.util.List;
>>>>>>>
import java.util.List;
<<<<<<<
=======
signatureParameters.setEncryptionAlgorithm(EncryptionAlgorithm.ECDSA);
signatureParameters.setReferenceDigestAlgorithm(messageDigestAlgo);
>>>>>>>
signatureParameters.setReferenceDigestAlgorithm(messageDigestAlgo); |
<<<<<<<
bw.addMutation(defaultTablet);
bw.close();
// Read out the TabletLocationStates
MockCurrentState state = new MockCurrentState(new MergeInfo(
new KeyExtent(tableId, new Text("p"), new Text("e")), MergeInfo.Operation.MERGE));
// Verify the tablet state: hosted, and count
MetaDataStateStore metaDataStateStore = new MetaDataStateStore(context, state);
int count = 0;
for (TabletLocationState tss : metaDataStateStore) {
if (tss != null)
count++;
}
assertEquals(0, count); // the normal case is to skip tablets in a good state
// Create the hole
// Split the tablet at one end of the range
Mutation m = new KeyExtent(tableId, new Text("t"), new Text("p")).getPrevRowUpdateMutation();
TabletsSection.TabletColumnFamily.SPLIT_RATIO_COLUMN.put(m, new Value("0.5".getBytes()));
TabletsSection.TabletColumnFamily.OLD_PREV_ROW_COLUMN.put(m,
KeyExtent.encodePrevEndRow(new Text("o")));
update(accumuloClient, m);
// do the state check
MergeStats stats = scan(state, metaDataStateStore);
MergeState newState = stats.nextMergeState(accumuloClient, state);
assertEquals(MergeState.WAITING_FOR_OFFLINE, newState);
// unassign the tablets
BatchDeleter deleter = accumuloClient.createBatchDeleter(MetadataTable.NAME,
Authorizations.EMPTY, 1000, new BatchWriterConfig());
deleter.fetchColumnFamily(TabletsSection.CurrentLocationColumnFamily.NAME);
deleter.setRanges(Collections.singletonList(new Range()));
deleter.delete();
// now we should be ready to merge but, we have inconsistent metadata
stats = scan(state, metaDataStateStore);
assertEquals(MergeState.WAITING_FOR_OFFLINE, stats.nextMergeState(accumuloClient, state));
// finish the split
KeyExtent tablet = new KeyExtent(tableId, new Text("p"), new Text("o"));
m = tablet.getPrevRowUpdateMutation();
TabletsSection.TabletColumnFamily.SPLIT_RATIO_COLUMN.put(m, new Value("0.5".getBytes()));
update(accumuloClient, m);
metaDataStateStore
.setLocations(Collections.singletonList(new Assignment(tablet, state.someTServer)));
// onos... there's a new tablet online
stats = scan(state, metaDataStateStore);
assertEquals(MergeState.WAITING_FOR_CHOPPED, stats.nextMergeState(accumuloClient, state));
// chop it
m = tablet.getPrevRowUpdateMutation();
ChoppedColumnFamily.CHOPPED_COLUMN.put(m, new Value("junk".getBytes()));
update(accumuloClient, m);
stats = scan(state, metaDataStateStore);
assertEquals(MergeState.WAITING_FOR_OFFLINE, stats.nextMergeState(accumuloClient, state));
// take it offline
m = tablet.getPrevRowUpdateMutation();
Collection<Collection<String>> walogs = Collections.emptyList();
metaDataStateStore.unassign(
Collections.singletonList(
new TabletLocationState(tablet, null, state.someTServer, null, null, walogs, false)),
null);
// now we can split
stats = scan(state, metaDataStateStore);
assertEquals(MergeState.MERGING, stats.nextMergeState(accumuloClient, state));
=======
ChoppedColumnFamily.CHOPPED_COLUMN.put(prevRow, new Value("junk".getBytes()));
bw.addMutation(prevRow);
pr = split;
}
// Add the default tablet
Mutation defaultTablet = KeyExtent.getPrevRowUpdateMutation(new KeyExtent(tableId, null, pr));
defaultTablet.put(TabletsSection.CurrentLocationColumnFamily.NAME, new Text("123456"),
new Value("127.0.0.1:1234".getBytes()));
bw.addMutation(defaultTablet);
bw.close();
// Read out the TabletLocationStates
MockCurrentState state =
new MockCurrentState(new MergeInfo(new KeyExtent(tableId, new Text("p"), new Text("e")),
MergeInfo.Operation.MERGE));
// Verify the tablet state: hosted, and count
MetaDataStateStore metaDataStateStore = new MetaDataStateStore(context, state);
int count = 0;
for (TabletLocationState tss : metaDataStateStore) {
if (tss != null)
count++;
>>>>>>>
bw.addMutation(defaultTablet);
bw.close();
// Read out the TabletLocationStates
MockCurrentState state =
new MockCurrentState(new MergeInfo(new KeyExtent(tableId, new Text("p"), new Text("e")),
MergeInfo.Operation.MERGE));
// Verify the tablet state: hosted, and count
MetaDataStateStore metaDataStateStore = new MetaDataStateStore(context, state);
int count = 0;
for (TabletLocationState tss : metaDataStateStore) {
if (tss != null)
count++;
}
assertEquals(0, count); // the normal case is to skip tablets in a good state
// Create the hole
// Split the tablet at one end of the range
Mutation m = new KeyExtent(tableId, new Text("t"), new Text("p")).getPrevRowUpdateMutation();
TabletsSection.TabletColumnFamily.SPLIT_RATIO_COLUMN.put(m, new Value("0.5".getBytes()));
TabletsSection.TabletColumnFamily.OLD_PREV_ROW_COLUMN.put(m,
KeyExtent.encodePrevEndRow(new Text("o")));
update(accumuloClient, m);
// do the state check
MergeStats stats = scan(state, metaDataStateStore);
MergeState newState = stats.nextMergeState(accumuloClient, state);
assertEquals(MergeState.WAITING_FOR_OFFLINE, newState);
// unassign the tablets
BatchDeleter deleter = accumuloClient.createBatchDeleter(MetadataTable.NAME,
Authorizations.EMPTY, 1000, new BatchWriterConfig());
deleter.fetchColumnFamily(TabletsSection.CurrentLocationColumnFamily.NAME);
deleter.setRanges(Collections.singletonList(new Range()));
deleter.delete();
// now we should be ready to merge but, we have inconsistent metadata
stats = scan(state, metaDataStateStore);
assertEquals(MergeState.WAITING_FOR_OFFLINE, stats.nextMergeState(accumuloClient, state));
// finish the split
KeyExtent tablet = new KeyExtent(tableId, new Text("p"), new Text("o"));
m = tablet.getPrevRowUpdateMutation();
TabletsSection.TabletColumnFamily.SPLIT_RATIO_COLUMN.put(m, new Value("0.5".getBytes()));
update(accumuloClient, m);
metaDataStateStore
.setLocations(Collections.singletonList(new Assignment(tablet, state.someTServer)));
// onos... there's a new tablet online
stats = scan(state, metaDataStateStore);
assertEquals(MergeState.WAITING_FOR_CHOPPED, stats.nextMergeState(accumuloClient, state));
// chop it
m = tablet.getPrevRowUpdateMutation();
ChoppedColumnFamily.CHOPPED_COLUMN.put(m, new Value("junk".getBytes()));
update(accumuloClient, m);
stats = scan(state, metaDataStateStore);
assertEquals(MergeState.WAITING_FOR_OFFLINE, stats.nextMergeState(accumuloClient, state));
// take it offline
m = tablet.getPrevRowUpdateMutation();
Collection<Collection<String>> walogs = Collections.emptyList();
metaDataStateStore.unassign(
Collections.singletonList(
new TabletLocationState(tablet, null, state.someTServer, null, null, walogs, false)),
null);
// now we can split
stats = scan(state, metaDataStateStore);
assertEquals(MergeState.MERGING, stats.nextMergeState(accumuloClient, state)); |
<<<<<<<
previousRevisionDssDict = getDSSDictionaryPresentInRevision(extractBeforeSignatureValue(byteRange, signedContent));
=======
previousRevisionDssDict = getDSSDictionaryPresentInRevision(getOriginalBytes(byteRange, signedContent), pwd);
>>>>>>>
previousRevisionDssDict = getDSSDictionaryPresentInRevision(extractBeforeSignatureValue(byteRange, signedContent), pwd); |
<<<<<<<
// Generated on: 2019.03.28 at 11:36:13 AM CET
=======
// Generated on: 2019.03.27 at 01:40:46 PM CET
>>>>>>>
// Generated on: 2019.03.28 at 12:15:14 PM CET
<<<<<<<
@XmlJavaTypeAdapter(Adapter6 .class)
protected XmlRevocationOrigin origin;
@XmlElement(name = "Type", required = true, type = String.class)
@XmlJavaTypeAdapter(Adapter5 .class)
=======
@XmlJavaTypeAdapter(Adapter4 .class)
protected RevocationOriginType origin;
@XmlElement(name = "Type", required = true, type = String.class)
@XmlJavaTypeAdapter(Adapter5 .class)
>>>>>>>
@XmlJavaTypeAdapter(Adapter5 .class)
protected XmlRevocationOrigin origin;
@XmlElement(name = "Type", required = true, type = String.class)
@XmlJavaTypeAdapter(Adapter4 .class) |
<<<<<<<
xmlSignature.setTimestamps(getXmlTimestamps(signature));
xmlSignature.setFoundRevocations(getXmlRelatedRevocations(signature));
=======
>>>>>>>
xmlSignature.setFoundRevocations(getXmlRelatedRevocations(signature));
<<<<<<<
XmlRevocationOrigin revocationOriginType = XmlRevocationOrigin.valueOf(revocationToken.getOrigin().name());
=======
RevocationOriginType revocationOriginType = RevocationOriginType.valueOf(revocationToken.getOrigin().name());
>>>>>>>
XmlRevocationOrigin revocationOriginType = XmlRevocationOrigin.valueOf(revocationToken.getOrigin().name());
<<<<<<<
xmlRevocation.setSigningCertificate(getXmlSigningCertificate(revocationToken.getPublicKeyOfTheSigner()));
xmlRevocation.setCertificateChain(getXmlForCertificateChain(revocationToken.getPublicKeyOfTheSigner()));
=======
>>>>>>>
xmlRevocation.setSigningCertificate(getXmlSigningCertificate(revocationToken.getPublicKeyOfTheSigner()));
xmlRevocation.setCertificateChain(getXmlForCertificateChain(revocationToken.getPublicKeyOfTheSigner()));
<<<<<<<
private List<XmlRelatedRevocation> getXmlRelatedRevocations(AdvancedSignature signature) {
List<XmlRelatedRevocation> xmlRevocationRefs = new ArrayList<XmlRelatedRevocation>();
xmlRevocationRefs.addAll(getXmlRevocationsRefsByType(signature, signature.getRevocationValuesTokens(),
XmlRevocationOrigin.INTERNAL_REVOCATION_VALUES));
xmlRevocationRefs.addAll(getXmlRevocationsRefsByType(signature, signature.getAttributeRevocationValuesTokens(),
XmlRevocationOrigin.INTERNAL_ATTRIBUTE_REVOCATION_VALUES));
xmlRevocationRefs.addAll(getXmlRevocationsRefsByType(signature, signature.getTimestampRevocationValuesTokens(),
XmlRevocationOrigin.INTERNAL_TIMESTAMP_REVOCATION_VALUES));
xmlRevocationRefs.addAll(getXmlRevocationsRefsByType(signature, signature.getDSSDictionaryRevocationTokens(),
XmlRevocationOrigin.INTERNAL_DSS));
xmlRevocationRefs.addAll(getXmlRevocationsRefsByType(signature, signature.getVRIDictionaryRevocationTokens(),
XmlRevocationOrigin.INTERNAL_VRI));
=======
private List<XmlFoundTimestamp> getXmlFoundTimestamps(AdvancedSignature signature) {
List<XmlFoundTimestamp> foundTimestamps = new ArrayList<XmlFoundTimestamp>();
foundTimestamps.addAll(getFoundTimestamps(signature.getContentTimestamps()));
foundTimestamps.addAll(getFoundTimestamps(signature.getSignatureTimestamps()));
foundTimestamps.addAll(getFoundTimestamps(signature.getTimestampsX1()));
foundTimestamps.addAll(getFoundTimestamps(signature.getTimestampsX2()));
foundTimestamps.addAll(getFoundTimestamps(signature.getArchiveTimestamps()));
return foundTimestamps;
}
private List<XmlFoundTimestamp> getFoundTimestamps(List<TimestampToken> tsts) {
List<XmlFoundTimestamp> foundTimestamps = new ArrayList<XmlFoundTimestamp>();
for (TimestampToken timestampToken : tsts) {
XmlFoundTimestamp foundTimestamp = new XmlFoundTimestamp();
foundTimestamp.setTimestamp(xmlTimestamps.get(timestampToken.getDSSIdAsString()));
foundTimestamps.add(foundTimestamp);
}
return foundTimestamps;
}
private List<XmlCertificateRevocationRef> getXmlRelatedRevocations(AdvancedSignature signature) {
List<XmlCertificateRevocationRef> xmlRevocationRefs = new ArrayList<XmlCertificateRevocationRef>();
xmlRevocationRefs.addAll(getXmlRevocationsRefsByType(signature.getRevocationValuesTokens(),
RevocationOriginType.INTERNAL_REVOCATION_VALUES));
xmlRevocationRefs.addAll(getXmlRevocationsRefsByType(signature.getAttributeRevocationValuesTokens(),
RevocationOriginType.INTERNAL_ATTRIBUTE_REVOCATION_VALUES));
xmlRevocationRefs.addAll(getXmlRevocationsRefsByType(signature.getTimestampRevocationValuesTokens(),
RevocationOriginType.INTERNAL_TIMESTAMP_REVOCATION_VALUES));
xmlRevocationRefs.addAll(getXmlRevocationsRefsByType(signature.getDSSDictionaryRevocationTokens(),
RevocationOriginType.INTERNAL_DSS));
xmlRevocationRefs.addAll(getXmlRevocationsRefsByType(signature.getVRIDictionaryRevocationTokens(),
RevocationOriginType.INTERNAL_VRI));
>>>>>>>
private List<XmlFoundTimestamp> getXmlFoundTimestamps(AdvancedSignature signature) {
List<XmlFoundTimestamp> foundTimestamps = new ArrayList<XmlFoundTimestamp>();
foundTimestamps.addAll(getFoundTimestamps(signature.getContentTimestamps()));
foundTimestamps.addAll(getFoundTimestamps(signature.getSignatureTimestamps()));
foundTimestamps.addAll(getFoundTimestamps(signature.getTimestampsX1()));
foundTimestamps.addAll(getFoundTimestamps(signature.getTimestampsX2()));
foundTimestamps.addAll(getFoundTimestamps(signature.getArchiveTimestamps()));
return foundTimestamps;
}
private List<XmlFoundTimestamp> getFoundTimestamps(List<TimestampToken> tsts) {
List<XmlFoundTimestamp> foundTimestamps = new ArrayList<XmlFoundTimestamp>();
for (TimestampToken timestampToken : tsts) {
XmlFoundTimestamp foundTimestamp = new XmlFoundTimestamp();
foundTimestamp.setTimestamp(xmlTimestamps.get(timestampToken.getDSSIdAsString()));
foundTimestamps.add(foundTimestamp);
}
return foundTimestamps;
}
private List<XmlRelatedRevocation> getXmlRelatedRevocations(AdvancedSignature signature) {
List<XmlRelatedRevocation> xmlRevocationRefs = new ArrayList<XmlRelatedRevocation>();
xmlRevocationRefs.addAll(getXmlRevocationsRefsByType(signature, signature.getRevocationValuesTokens(),
XmlRevocationOrigin.INTERNAL_REVOCATION_VALUES));
xmlRevocationRefs.addAll(getXmlRevocationsRefsByType(signature, signature.getAttributeRevocationValuesTokens(),
XmlRevocationOrigin.INTERNAL_ATTRIBUTE_REVOCATION_VALUES));
xmlRevocationRefs.addAll(getXmlRevocationsRefsByType(signature, signature.getTimestampRevocationValuesTokens(),
XmlRevocationOrigin.INTERNAL_TIMESTAMP_REVOCATION_VALUES));
xmlRevocationRefs.addAll(getXmlRevocationsRefsByType(signature, signature.getDSSDictionaryRevocationTokens(),
XmlRevocationOrigin.INTERNAL_DSS));
xmlRevocationRefs.addAll(getXmlRevocationsRefsByType(signature, signature.getVRIDictionaryRevocationTokens(),
XmlRevocationOrigin.INTERNAL_VRI));
<<<<<<<
private XmlRelatedRevocation getXmlCertificateRevocationRef(AdvancedSignature signature, RevocationToken revocationToken,
XmlRevocationOrigin originType) {
XmlRelatedRevocation xmlRevocationRef = new XmlRelatedRevocation();
xmlRevocationRef.setCertificate(getXmlCertificate(revocationToken.getRelatedCertificateID()));
xmlRevocationRef.setRevocation(getXmlRevocation(revocationToken.getDSSIdAsString(), revocationToken));
=======
private XmlCertificateRevocationRef getXmlCertificateRevocationRef(RevocationToken revocationToken, RevocationOriginType originType) {
XmlCertificateRevocationRef xmlRevocationRef = new XmlCertificateRevocationRef();
xmlRevocationRef.setCertificate(xmlCerts.get(revocationToken.getRelatedCertificateID()));
xmlRevocationRef.setRevocation(xmlRevocations.get(revocationToken.getDSSIdAsString()));
>>>>>>>
private XmlRelatedRevocation getXmlCertificateRevocationRef(AdvancedSignature signature, RevocationToken revocationToken,
XmlRevocationOrigin originType) {
XmlRelatedRevocation xmlRevocationRef = new XmlRelatedRevocation();
xmlRevocationRef.setCertificate(xmlCerts.get(revocationToken.getRelatedCertificateID()));
xmlRevocationRef.setRevocation(xmlRevocations.get(revocationToken.getDSSIdAsString()));
<<<<<<<
=======
>>>>>>> |
<<<<<<<
import static org.junit.Assert.assertFalse;
=======
import static org.junit.Assert.assertNotNull;
>>>>>>>
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
<<<<<<<
// BufferedImage differenceImage = PdfScreenshotUtils.getDifferenceImage(dssDocument, expected);
// ImageIO.write(differenceImage, "PNG", new File("target/diff.png"));
assertFalse(PdfScreenshotUtils.areVisuallyEqual(dssDocument, expected));
=======
DSSDocument subtractionImage = PdfBoxUtils.generateSubtractionImage(dssDocument, expected, 1);
assertNotNull(subtractionImage);
// subtractionImage.save("target/diff.png");
}
@Override
protected String getSigningAlias() {
return null;
>>>>>>>
assertFalse(areVisuallyEqual(dssDocument, expected));
DSSDocument subtractionImage = PdfBoxUtils.generateSubtractionImage(dssDocument, expected, 1);
assertNotNull(subtractionImage);
}
@Override
protected String getTestName() {
// TODO Auto-generated method stub
return null;
}
@Override
protected PAdESService getService() {
// TODO Auto-generated method stub
return null;
}
@Override
protected DSSDocument getDocumentToSign() {
// TODO Auto-generated method stub
return null;
}
@Override
protected PAdESSignatureParameters getSignatureParameters() {
// TODO Auto-generated method stub
return null; |
<<<<<<<
import eu.europa.esig.dss.enumerations.Indication;
import eu.europa.esig.dss.enumerations.SignatureQualification;
import eu.europa.esig.dss.enumerations.SubIndication;
=======
import eu.europa.esig.dss.jaxb.detailedreport.DetailedReportFacade;
>>>>>>>
import eu.europa.esig.dss.enumerations.Indication;
import eu.europa.esig.dss.enumerations.SignatureQualification;
import eu.europa.esig.dss.enumerations.SubIndication;
import eu.europa.esig.dss.jaxb.detailedreport.DetailedReportFacade; |
<<<<<<<
=======
import java.util.HashMap;
import java.util.List;
>>>>>>>
import java.util.List; |
<<<<<<<
// DSSID as key (used in the administration screen)
store.setCertificateEntry(europanCert.getDSSIdAsString(), europanCert.getCertificate());
IOUtils.closeQuietly(fis);
=======
store.setCertificateEntry(alias, europanCert.getCertificate());
Utils.closeQuietly(fis);
>>>>>>>
// DSSID as key (used in the administration screen)
store.setCertificateEntry(europanCert.getDSSIdAsString(), europanCert.getCertificate());
Utils.closeQuietly(fis); |
<<<<<<<
BBB_SAV_DSCACRCC,
BBB_SAV_DSCACRCC_ANS,
BBB_SAV_ACPCCRSCA,
BBB_SAV_ACPCCRSCA_ANS,
=======
ASCCM_ANS_7,
ACCM_POS_SIG_SIG,
ACCM_POS_TST_SIG,
ACCM_POS_REVOC_SIG,
ACCM_POS_REF,
ACCM_POS_MESS_IMP,
ACCM_POS_CERT_CHAIN_SIG,
ACCM_POS_CERT_CHAIN_TST,
ACCM_POS_CERT_CHAIN_REVOC,
ACCM_POS_CERT_CHAIN,
>>>>>>>
ASCCM_ANS_7,
ACCM_POS_SIG_SIG,
ACCM_POS_TST_SIG,
ACCM_POS_REVOC_SIG,
ACCM_POS_REF,
ACCM_POS_MESS_IMP,
ACCM_POS_CERT_CHAIN_SIG,
ACCM_POS_CERT_CHAIN_TST,
ACCM_POS_CERT_CHAIN_REVOC,
ACCM_POS_CERT_CHAIN,
BBB_SAV_DSCACRCC,
BBB_SAV_DSCACRCC_ANS,
BBB_SAV_ACPCCRSCA,
BBB_SAV_ACPCCRSCA_ANS, |
<<<<<<<
import eu.europa.esig.dss.diagnostic.jaxb.XmlCertificateRef;
import eu.europa.esig.dss.diagnostic.jaxb.XmlCommitmentTypeIndication;
=======
>>>>>>>
import eu.europa.esig.dss.diagnostic.jaxb.XmlCommitmentTypeIndication; |
<<<<<<<
import java.util.Objects;
=======
import java.util.stream.Collectors;
>>>>>>>
import java.util.Objects;
import java.util.stream.Collectors;
<<<<<<<
public static final String ZIP_ENTRY_DETACHED_FILE = "detached-file";
=======
public static final String XML_EXTENSION = ".xml";
>>>>>>>
public static final String ZIP_ENTRY_DETACHED_FILE = "detached-file";
public static final String XML_EXTENSION = ".xml"; |
<<<<<<<
import eu.europa.esig.dss.spi.x509.SerialInfo;
=======
import eu.europa.esig.dss.spi.x509.revocation.Revocation;
import eu.europa.esig.dss.spi.x509.revocation.RevocationCertificateSource;
>>>>>>>
import eu.europa.esig.dss.spi.x509.SerialInfo;
import eu.europa.esig.dss.spi.x509.revocation.Revocation;
import eu.europa.esig.dss.spi.x509.revocation.RevocationCertificateSource; |
<<<<<<<
System.out.println(hql);
return getSession().createQuery(hql).list();
=======
return getQuery(hql, condition.getPageInfo()).list();
>>>>>>>
System.out.println(hql);
return getQuery(hql, condition.getPageInfo()).list(); |
<<<<<<<
import cn.edu.uestc.acmicpc.db.dao.iface.IDepartmentDAO;
import cn.edu.uestc.acmicpc.ioc.dao.DepartmentDAOAware;
import cn.edu.uestc.acmicpc.ioc.util.GlobalAware;
import cn.edu.uestc.acmicpc.util.Global;
import cn.edu.uestc.acmicpc.util.exception.FieldException;
=======
>>>>>>>
import cn.edu.uestc.acmicpc.db.dao.iface.IDepartmentDAO;
import cn.edu.uestc.acmicpc.ioc.dao.DepartmentDAOAware;
import cn.edu.uestc.acmicpc.ioc.util.GlobalAware;
import cn.edu.uestc.acmicpc.util.Global;
import cn.edu.uestc.acmicpc.util.exception.FieldException; |
<<<<<<<
public void onApiConnected(DroidPlannerApi api){
super.onApiConnected(api);
if(mapFragment != null){
mapFragment.onApiConnected(api);
}
if(flightActions != null){
flightActions.onApiConnected(api);
}
if(telemetryFragment != null)
telemetryFragment.onApiConnected(api);
if(flightModePanel != null)
flightModePanel.onApiConnected(api);
enableSlidingUpPanel(this.dpApi);
}
@Override
public void onApiDisconnected(){
super.onApiDisconnected();
if(mapFragment != null)
mapFragment.onApiDisconnected();
if(flightActions != null)
flightActions.onApiDisconnected();
if(telemetryFragment != null)
telemetryFragment.onApiDisconnected();
if(flightModePanel != null)
flightModePanel.onApiDisconnected();
}
@Override
public boolean onCreateOptionsMenu(Menu menu){
// Reset the previous info bar
if (infoBar != null) {
infoBar.setDrone(null);
infoBar = null;
}
getMenuInflater().inflate(R.menu.menu_flight_activity, menu);
final MenuItem infoBarItem = menu.findItem(R.id.menu_info_bar);
if (infoBarItem != null)
infoBar = (InfoBarActionProvider) infoBarItem.getActionProvider();
if(dpApi != null && dpApi.isConnected()) {
if (infoBar != null) {
infoBar.setDrone(dpApi.getDrone());
}
}
else{
if (infoBar != null) {
infoBar.setDrone(null);
}
}
return super.onCreateOptionsMenu(menu);
=======
protected int getNavigationDrawerEntryId() {
return R.id.navigation_flight_data;
>>>>>>>
public void onApiConnected(DroidPlannerApi api){
super.onApiConnected(api);
if(mapFragment != null){
mapFragment.onApiConnected(api);
}
if(flightActions != null){
flightActions.onApiConnected(api);
}
if(telemetryFragment != null)
telemetryFragment.onApiConnected(api);
if(flightModePanel != null)
flightModePanel.onApiConnected(api);
enableSlidingUpPanel(this.dpApi);
}
@Override
public void onApiDisconnected(){
super.onApiDisconnected();
if(mapFragment != null)
mapFragment.onApiDisconnected();
if(flightActions != null)
flightActions.onApiDisconnected();
if(telemetryFragment != null)
telemetryFragment.onApiDisconnected();
if(flightModePanel != null)
flightModePanel.onApiDisconnected();
}
@Override
protected int getNavigationDrawerEntryId() {
return R.id.navigation_flight_data; |
<<<<<<<
import java.util.concurrent.SynchronousQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
=======
>>>>>>>
import java.util.concurrent.SynchronousQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
<<<<<<<
import org.apache.accumulo.core.util.SimpleThreadPool;
import org.apache.accumulo.fate.util.LoggingRunnable;
=======
import org.apache.accumulo.core.util.UtilWaitThread;
import org.apache.accumulo.fate.zookeeper.Retry;
import org.apache.accumulo.fate.zookeeper.RetryFactory;
>>>>>>>
import org.apache.accumulo.core.util.SimpleThreadPool;
import org.apache.accumulo.fate.util.LoggingRunnable;
import org.apache.accumulo.fate.zookeeper.Retry;
import org.apache.accumulo.fate.zookeeper.RetryFactory;
<<<<<<<
import com.google.common.cache.Cache;
import com.google.common.cache.CacheBuilder;
import static com.google.common.util.concurrent.Uninterruptibles.sleepUninterruptibly;
=======
>>>>>>>
import static com.google.common.util.concurrent.Uninterruptibles.sleepUninterruptibly;
<<<<<<<
startLogMaker();
Object next = nextLog.take();
if (next instanceof Exception) {
throw (Exception) next;
}
if (next instanceof DfsLogger) {
currentLog = (DfsLogger) next;
logId.incrementAndGet();
log.info("Using next log " + currentLog.getFileName());
return;
} else {
throw new RuntimeException("Error: unexpected type seen: " + next);
}
=======
DfsLogger alog = new DfsLogger(tserver.getServerConfig(), syncCounter, flushCounter);
alog.open(tserver.getClientAddressString());
loggers.add(alog);
logSetId.incrementAndGet();
// When we successfully create a WAL, make sure to reset the Retry.
if (null != retry) {
retry = null;
}
return;
>>>>>>>
startLogMaker();
Object next = nextLog.take();
if (next instanceof Exception) {
throw (Exception) next;
}
if (next instanceof DfsLogger) {
currentLog = (DfsLogger) next;
logId.incrementAndGet();
log.info("Using next log " + currentLog.getFileName());
// When we successfully create a WAL, make sure to reset the Retry.
if (null != retry) {
retry = null;
}
return;
} else {
throw new RuntimeException("Error: unexpected type seen: " + next);
} |
<<<<<<<
=======
private TextView textViewTitle;
>>>>>>>
<<<<<<<
spinnerSetup.setAdapter(adapter);
=======
if(adapter!=null)
spinnerSetup.setAdapter(adapter);
>>>>>>>
spinnerSetup.setAdapter(adapter); |
<<<<<<<
HOSTED(TUnloadTabletGoal.UNKNOWN), UNASSIGNED(TUnloadTabletGoal.UNASSIGNED), DELETED(TUnloadTabletGoal.DELETED), SUSPENDED(TUnloadTabletGoal.SUSPENDED);
private final TUnloadTabletGoal unloadGoal;
TabletGoalState(TUnloadTabletGoal unloadGoal) {
this.unloadGoal = unloadGoal;
}
/** The purpose of unloading this tablet. */
public TUnloadTabletGoal howUnload() {
return unloadGoal;
}
};
=======
HOSTED, UNASSIGNED, DELETED
}
>>>>>>>
HOSTED(TUnloadTabletGoal.UNKNOWN), UNASSIGNED(TUnloadTabletGoal.UNASSIGNED), DELETED(TUnloadTabletGoal.DELETED), SUSPENDED(TUnloadTabletGoal.SUSPENDED);
private final TUnloadTabletGoal unloadGoal;
TabletGoalState(TUnloadTabletGoal unloadGoal) {
this.unloadGoal = unloadGoal;
}
/** The purpose of unloading this tablet. */
public TUnloadTabletGoal howUnload() {
return unloadGoal;
}
} |
<<<<<<<
=======
import org.droidplanner.core.model.Drone;
import org.droidplanner.core.survey.Footprint;
import org.droidplanner.core.drone.DroneInterfaces;
import org.droidplanner.core.helpers.coordinates.Coord2D;
>>>>>>>
<<<<<<<
private static final IntentFilter eventFilter = new IntentFilter(Event.EVENT_GPS);
private final BroadcastReceiver eventReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
final DroneApi droneApi = getDroneApi();
if(!droneApi.isConnected())
return;
Gps droneGps = droneApi.getGps();
if (mPanMode.get() == AutoPanMode.DRONE && droneGps.isValid()) {
final float currentZoomLevel = getMap().getCameraPosition().zoom;
final LatLong droneLocation = droneGps.getPosition();
updateCamera(droneLocation, currentZoomLevel);
}
}
};
=======
>>>>>>>
private static final IntentFilter eventFilter = new IntentFilter(Event.EVENT_GPS);
private final BroadcastReceiver eventReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
final DroneApi droneApi = getDroneApi();
if(!droneApi.isConnected())
return;
Gps droneGps = droneApi.getGps();
if (mPanMode.get() == AutoPanMode.DRONE && droneGps.isValid()) {
final float currentZoomLevel = getMap().getCameraPosition().zoom;
final LatLong droneLocation = droneGps.getPosition();
updateCamera(droneLocation, currentZoomLevel);
}
}
};
<<<<<<<
protected DroidPlannerApp dpApp;
@Override
public void onAttach(Activity activity){
super.onAttach(activity);
dpApp = (DroidPlannerApp) activity.getApplication();
}
=======
private List<Polygon> polygonsPaths = new ArrayList<Polygon>();
>>>>>>>
private List<Polygon> polygonsPaths = new ArrayList<Polygon>();
protected DroidPlannerApp dpApp;
@Override
public void onAttach(Activity activity){
super.onAttach(activity);
dpApp = (DroidPlannerApp) activity.getApplication();
} |
<<<<<<<
import org.droidplanner.android.proxy.mission.item.MissionItemProxy;
import org.droidplanner.android.proxy.mission.MissionProxy;
=======
import org.droidplanner.android.mission.MissionRender;
import org.droidplanner.android.mission.MissionSelection;
import org.droidplanner.android.mission.item.MissionItemRender;
>>>>>>>
import org.droidplanner.android.mission.MissionSelection;
import org.droidplanner.android.proxy.mission.item.MissionItemProxy;
import org.droidplanner.android.proxy.mission.MissionProxy;
<<<<<<<
OnClickListener, MissionProxy.OnSelectionUpdateListener {
=======
OnClickListener, MissionSelection.OnSelectionUpdateListener {
>>>>>>>
OnClickListener, MissionSelection.OnSelectionUpdateListener {
<<<<<<<
missionProxy.addSelectionUpdateListener(this);
=======
missionRender.selection.addSelectionUpdateListener(this);
>>>>>>>
missionProxy.selection.addSelectionUpdateListener(this);
<<<<<<<
missionProxy.removeSelectionUpdateListener(this);
=======
missionRender.selection.removeSelectionUpdateListener(this);
>>>>>>>
missionProxy.selection.removeSelectionUpdateListener(this);
<<<<<<<
public void deleteSelected() {
SparseBooleanArray selected = list.getCheckedItemPositions();
ArrayList<MissionItemProxy> toRemove = new ArrayList<MissionItemProxy>();
for (int i = 0; i < selected.size(); i++) {
if (selected.valueAt(i)) {
MissionItemProxy item = adapter.getItem(selected.keyAt(i));
toRemove.add(item);
}
}
missionProxy.removeWaypoints(toRemove);
}
=======
>>>>>>> |
<<<<<<<
=======
public void testSetInstance_HdfsZooInstance_Explicit() throws Exception {
testSetInstance_HdfsZooInstance(true, false, false);
}
@Test
public void testSetInstance_HdfsZooInstance_InstanceGiven() throws Exception {
testSetInstance_HdfsZooInstance(false, true, false);
}
@Test
public void testSetInstance_HdfsZooInstance_HostsGiven() throws Exception {
testSetInstance_HdfsZooInstance(false, false, true);
}
@Test
public void testSetInstance_HdfsZooInstance_Implicit() throws Exception {
testSetInstance_HdfsZooInstance(false, false, false);
}
private void testSetInstance_HdfsZooInstance(boolean explicitHdfs, boolean onlyInstance,
boolean onlyHosts) throws Exception {
ClientConfiguration clientConf = createMock(ClientConfiguration.class);
ShellOptionsJC opts = createMock(ShellOptionsJC.class);
expect(opts.isFake()).andReturn(false);
expect(opts.getClientConfiguration()).andReturn(clientConf);
expect(opts.isHdfsZooInstance()).andReturn(explicitHdfs);
if (!explicitHdfs) {
expect(opts.getZooKeeperInstance()).andReturn(Collections.<String> emptyList());
if (onlyInstance) {
expect(opts.getZooKeeperInstanceName()).andReturn("instance");
expect(clientConf.withInstance("instance")).andReturn(clientConf);
} else {
expect(opts.getZooKeeperInstanceName()).andReturn(null);
}
if (onlyHosts) {
expect(opts.getZooKeeperHosts()).andReturn("host3,host4");
expect(clientConf.withZkHosts("host3,host4")).andReturn(clientConf);
} else {
expect(opts.getZooKeeperHosts()).andReturn(null);
}
}
replay(opts);
if (!onlyInstance) {
expect(clientConf.get(ClientProperty.INSTANCE_NAME)).andReturn(null);
}
mockStatic(ConfigSanityCheck.class);
ConfigSanityCheck.validate(EasyMock.<AccumuloConfiguration> anyObject());
expectLastCall().atLeastOnce();
replay(ConfigSanityCheck.class);
if (!onlyHosts) {
expect(clientConf.containsKey(ClientProperty.INSTANCE_ZK_HOST.getKey())).andReturn(true)
.atLeastOnce();
expect(clientConf.get(ClientProperty.INSTANCE_ZK_HOST)).andReturn("host1,host2")
.atLeastOnce();
expect(clientConf.withZkHosts("host1,host2")).andReturn(clientConf);
}
if (!onlyInstance) {
expect(clientConf.containsKey(Property.INSTANCE_VOLUMES.getKey())).andReturn(false)
.atLeastOnce();
@SuppressWarnings("deprecation")
String INSTANCE_DFS_DIR_KEY = Property.INSTANCE_DFS_DIR.getKey();
@SuppressWarnings("deprecation")
String INSTANCE_DFS_URI_KEY = Property.INSTANCE_DFS_URI.getKey();
expect(clientConf.containsKey(INSTANCE_DFS_DIR_KEY)).andReturn(true).atLeastOnce();
expect(clientConf.containsKey(INSTANCE_DFS_URI_KEY)).andReturn(true).atLeastOnce();
expect(clientConf.getString(INSTANCE_DFS_URI_KEY)).andReturn("hdfs://nn1").atLeastOnce();
expect(clientConf.getString(INSTANCE_DFS_DIR_KEY)).andReturn("/dfs").atLeastOnce();
}
UUID randomUUID = null;
if (!onlyInstance) {
mockStatic(ZooUtil.class);
randomUUID = UUID.randomUUID();
expect(ZooUtil.getInstanceIDFromHdfs(anyObject(Path.class),
anyObject(AccumuloConfiguration.class))).andReturn(randomUUID.toString());
replay(ZooUtil.class);
expect(clientConf.withInstance(randomUUID)).andReturn(clientConf);
}
replay(clientConf);
ZooKeeperInstance theInstance = createMock(ZooKeeperInstance.class);
expectNew(ZooKeeperInstance.class, new Class<?>[] {ClientConfiguration.class}, clientConf)
.andReturn(theInstance);
replay(theInstance, ZooKeeperInstance.class);
shell.setInstance(opts);
verify(theInstance, ZooKeeperInstance.class);
}
@Test
>>>>>>>
<<<<<<<
expect(opts.getClientProperties()).andReturn(new Properties());
expect(props.getProperty(Property.GENERAL_SECURITY_CREDENTIAL_PROVIDER_PATHS.getKey())).andReturn(null);
=======
expect(opts.getClientConfiguration()).andReturn(clientConf);
expect(opts.isHdfsZooInstance()).andReturn(false);
expect(clientConf.getKeys()).andReturn(Arrays
.asList(ClientProperty.INSTANCE_NAME.getKey(), ClientProperty.INSTANCE_ZK_HOST.getKey())
.iterator());
expect(clientConf.getString(Property.GENERAL_SECURITY_CREDENTIAL_PROVIDER_PATHS.getKey()))
.andReturn(null);
>>>>>>>
expect(opts.getClientProperties()).andReturn(new Properties());
expect(props.getProperty(Property.GENERAL_SECURITY_CREDENTIAL_PROVIDER_PATHS.getKey()))
.andReturn(null);
<<<<<<<
expect(props.getProperty(ClientProperty.INSTANCE_NAME.getKey())).andReturn("foo");
expect(props.getProperty(ClientProperty.INSTANCE_ZOOKEEPERS.getKey())).andReturn("host1,host2");
=======
expect(clientConf.withInstance("foo")).andReturn(clientConf);
expect(clientConf.getString(ClientProperty.INSTANCE_NAME.getKey())).andReturn("foo");
expect(clientConf.withZkHosts("host1,host2")).andReturn(clientConf);
expect(clientConf.getString(ClientProperty.INSTANCE_ZK_HOST.getKey()))
.andReturn("host1,host2");
>>>>>>>
expect(props.getProperty(ClientProperty.INSTANCE_NAME.getKey())).andReturn("foo");
expect(props.getProperty(ClientProperty.INSTANCE_ZOOKEEPERS.getKey()))
.andReturn("host1,host2");
<<<<<<<
expect(props.getProperty(ClientProperty.INSTANCE_NAME.getKey())).andReturn("bar");
expect(props.getProperty(ClientProperty.INSTANCE_ZOOKEEPERS.getKey())).andReturn("host3,host4");
expect(opts.getZooKeeperInstance()).andReturn(Collections.emptyList());
=======
expect(clientConf.withInstance("bar")).andReturn(clientConf);
expect(clientConf.getString(ClientProperty.INSTANCE_NAME.getKey())).andReturn("bar");
expect(clientConf.withZkHosts("host3,host4")).andReturn(clientConf);
expect(clientConf.getString(ClientProperty.INSTANCE_ZK_HOST.getKey()))
.andReturn("host3,host4");
expect(opts.getZooKeeperInstance()).andReturn(Collections.<String> emptyList());
>>>>>>>
expect(props.getProperty(ClientProperty.INSTANCE_NAME.getKey())).andReturn("bar");
expect(props.getProperty(ClientProperty.INSTANCE_ZOOKEEPERS.getKey()))
.andReturn("host3,host4");
expect(opts.getZooKeeperInstance()).andReturn(Collections.emptyList());
<<<<<<<
expectNew(ZooKeeperInstance.class, new Class<?>[] {String.class, String.class}, "bar", "host3,host4").andReturn(theInstance);
=======
expectNew(ZooKeeperInstance.class, new Class<?>[] {ClientConfiguration.class}, clientConf)
.andReturn(theInstance);
>>>>>>>
expectNew(ZooKeeperInstance.class, new Class<?>[] {String.class, String.class}, "bar",
"host3,host4").andReturn(theInstance); |
<<<<<<<
import org.droidplanner.android.proxy.mission.item.MissionItemProxy;
import org.droidplanner.android.proxy.mission.MissionProxy;
=======
import org.droidplanner.android.mission.item.MissionItemRender;
import org.droidplanner.android.mission.MissionRender;
import org.droidplanner.android.mission.MissionSelection;
>>>>>>>
import org.droidplanner.android.mission.MissionSelection;
import org.droidplanner.android.proxy.mission.item.MissionItemProxy;
import org.droidplanner.android.proxy.mission.MissionProxy;
<<<<<<<
OnEditorInteraction, Callback, MissionProxy.OnSelectionUpdateListener {
=======
OnEditorInteraction, Callback, MissionSelection.OnSelectionUpdateListener {
>>>>>>>
OnEditorInteraction, Callback, MissionSelection.OnSelectionUpdateListener {
<<<<<<<
missionProxy.addSelectionUpdateListener(this);
=======
missionRender.selection.addSelectionUpdateListener(this);
>>>>>>>
missionProxy.selection.addSelectionUpdateListener(this);
<<<<<<<
missionProxy.removeSelectionUpdateListener(this);
=======
missionRender.selection.removeSelectionUpdateListener(this);
>>>>>>>
missionProxy.selection.removeSelectionUpdateListener(this);
<<<<<<<
missionProxy.clearSelection();
=======
missionRender.selection.clearSelection();
>>>>>>>
missionProxy.selection.clearSelection();
<<<<<<<
missionProxy.clearSelection();
=======
missionRender.selection.clearSelection();
>>>>>>>
missionProxy.selection.clearSelection();
<<<<<<<
private void showItemDetail(MissionItemProxy item) {
=======
@Override
public void editorToolLongClicked(EditorTools tools) {
switch (tools) {
case TRASH: {
// Clear the mission?
doClearMissionConfirmation();
break;
}
default: {
break;
}
}
}
private void showItemDetail(MissionItemRender item) {
>>>>>>>
@Override
public void editorToolLongClicked(EditorTools tools) {
switch (tools) {
case TRASH: {
// Clear the mission?
doClearMissionConfirmation();
break;
}
default: {
break;
}
}
}
private void showItemDetail(MissionItemProxy item) {
<<<<<<<
missionProxy.removeWaypoints(missionProxy.getSelected());
=======
missionRender.removeSelection(missionRender.selection);
>>>>>>>
missionProxy.removeSelection(missionProxy.selection);
<<<<<<<
missionProxy.clearSelection();
=======
missionRender.selection.clearSelection();
>>>>>>>
missionProxy.selection.clearSelection();
<<<<<<<
missionProxy.setSelectionTo(item);
=======
missionRender.selection.setSelectionTo(item);
>>>>>>>
missionProxy.selection.setSelectionTo(item);
<<<<<<<
if (missionProxy.selectionContains(item)) {
missionProxy.clearSelection();
=======
if (missionRender.selection.selectionContains(item)) {
missionRender.selection.clearSelection();
>>>>>>>
if (missionProxy.selection.selectionContains(item)) {
missionProxy.selection.clearSelection();
<<<<<<<
missionProxy.setSelectionTo(item);
=======
missionRender.selection.setSelectionTo(item);
>>>>>>>
missionProxy.selection.setSelectionTo(item);
<<<<<<<
missionProxy.removeWaypoint(item);
missionProxy.clearSelection();
if (missionProxy.getItems().size() <= 0) {
=======
missionRender.removeItem(item);
missionRender.selection.clearSelection();
if (missionRender.getItems().size() <= 0) {
>>>>>>>
missionProxy.removeItem(item);
missionProxy.selection.clearSelection();
if (missionProxy.getItems().size() <= 0) { |
<<<<<<<
private InfoBarActionProvider infoBar;
protected DroidPlannerApi dpApi;
=======
private GCSHeartbeat gcsHeartbeat;
public DroidPlannerApp app;
public Drone drone;
>>>>>>>
protected DroidPlannerApi dpApi;
<<<<<<<
unsetApiHandle();
unbindService(dpServiceConnection);
=======
drone.removeDroneListener(this);
>>>>>>>
unsetApiHandle();
unbindService(dpServiceConnection);
<<<<<<<
case R.id.menu_send_mission:
if(dpApi != null) {
final MissionProxy missionProxy = dpApi.getMissionProxy();
if (dpApi.getDrone().getMission().hasTakeoffAndLandOrRTL()) {
missionProxy.sendMissionToAPM();
} else {
YesNoWithPrefsDialog dialog = YesNoWithPrefsDialog.newInstance(getApplicationContext(),
"Mission Upload", "Do you want to append a Takeoff and RTL to your " +
"mission?", "Ok", "Skip", new YesNoDialog.Listener() {
@Override
public void onYes() {
missionProxy.addTakeOffAndRTL();
missionProxy.sendMissionToAPM();
}
@Override
public void onNo() {
missionProxy.sendMissionToAPM();
}
},
getString(R.string.pref_auto_insert_mission_takeoff_rtl_land_key));
if (dialog != null) {
dialog.show(getSupportFragmentManager(), "Mission Upload check.");
}
}
}
return true;
=======
>>>>>>>
<<<<<<<
startService(new Intent(getApplicationContext(), DroidPlannerService.class).setAction
(DroidPlannerService.ACTION_TOGGLE_DRONE_CONNECTION));
}
=======
if (!drone.getMavClient().isConnected()) {
final String connectionType = mAppPrefs.getMavLinkConnectionType();
if (Utils.ConnectionType.BLUETOOTH.name().equals(connectionType)) {
// Launch a bluetooth device selection screen for the user
final String address = mAppPrefs.getBluetoothDeviceAddress();
if (address == null || address.isEmpty()) {
new BTDeviceListFragment().show(getSupportFragmentManager(),
"Device selection dialog");
return;
}
}
}
drone.getMavClient().toggleConnectionState();
}
>>>>>>>
startService(new Intent(getApplicationContext(), DroidPlannerService.class).setAction
(DroidPlannerService.ACTION_TOGGLE_DRONE_CONNECTION));
} |
<<<<<<<
import com.droidplanner.MAVLink.parameters.Parameter;
import com.droidplanner.MAVLink.parameters.ParametersManager;
import com.droidplanner.MAVLink.parameters.ParametersManager.OnParameterManagerListner;
import com.droidplanner.MAVLink.waypoints.WaypointMananger;
import com.droidplanner.MAVLink.waypoints.WaypointMananger.OnWaypointManagerListner;
=======
import com.droidplanner.MAVLink.WaypointMananger;
import com.droidplanner.MAVLink.WaypointMananger.OnWaypointManagerListner;
import com.droidplanner.helpers.FollowMe;
>>>>>>>
import com.droidplanner.MAVLink.parameters.Parameter;
import com.droidplanner.MAVLink.parameters.ParametersManager;
import com.droidplanner.MAVLink.parameters.ParametersManager.OnParameterManagerListner;
import com.droidplanner.MAVLink.waypoints.WaypointMananger;
import com.droidplanner.MAVLink.waypoints.WaypointMananger.OnWaypointManagerListner;
import com.droidplanner.helpers.FollowMe;
<<<<<<<
public ParametersManager parameterMananger;
private MavLinkMsgHandler mavLinkMsgHandler;
=======
public FollowMe followMe;
>>>>>>>
public ParametersManager parameterMananger;
private MavLinkMsgHandler mavLinkMsgHandler;
public FollowMe followMe;
<<<<<<<
parameterMananger = new ParametersManager(MAVClient, this);
mavLinkMsgHandler = new com.droidplanner.MAVLink.MavLinkMsgHandler(drone);
=======
followMe = new FollowMe(MAVClient, this,drone);
mavLinkMsgHandler = new com.droidplanner.MAVLink.MavLinkMsgHandler(drone);
>>>>>>>
parameterMananger = new ParametersManager(MAVClient, this);
followMe = new FollowMe(MAVClient, this,drone);
mavLinkMsgHandler = new com.droidplanner.MAVLink.MavLinkMsgHandler(drone); |
<<<<<<<
import org.droidplanner.android.proxy.mission.item.fragments.MissionDetailFragment;
import org.droidplanner.android.proxy.mission.item.fragments.MissionDetailFragment.OnWayPointTypeChangeListener;
=======
import org.droidplanner.android.fragments.helpers.MapProjection;
import org.droidplanner.android.mission.item.fragments.MissionDetailFragment;
import org.droidplanner.android.graphic.DroneHelper;
>>>>>>>
import org.droidplanner.android.proxy.mission.item.fragments.MissionDetailFragment;
import org.droidplanner.android.proxy.mission.item.fragments.MissionDetailFragment.OnWayPointTypeChangeListener;
<<<<<<<
mSplineToggleContainer = findViewById(R.id.editorSplineToggleContainer);
mSplineToggleContainer.setVisibility(View.VISIBLE);
final RadioButton normalToggle = (RadioButton) findViewById(R.id.normalWpToggle);
normalToggle.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
mIsSplineEnabled = !normalToggle.isChecked();
}
});
final RadioButton splineToggle = (RadioButton) findViewById(R.id.splineWpToggle);
splineToggle.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
mIsSplineEnabled = splineToggle.isChecked();
}
});
=======
//Retrieve the item detail fragment using its tag
itemDetailFragment = (MissionDetailFragment) fragmentManager.findFragmentByTag
(ITEM_DETAIL_TAG);
>>>>>>>
mSplineToggleContainer = findViewById(R.id.editorSplineToggleContainer);
mSplineToggleContainer.setVisibility(View.VISIBLE);
final RadioButton normalToggle = (RadioButton) findViewById(R.id.normalWpToggle);
normalToggle.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
mIsSplineEnabled = !normalToggle.isChecked();
}
});
final RadioButton splineToggle = (RadioButton) findViewById(R.id.splineWpToggle);
splineToggle.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
mIsSplineEnabled = splineToggle.isChecked();
}
});
//Retrieve the item detail fragment using its tag
itemDetailFragment = (MissionDetailFragment) fragmentManager.findFragmentByTag
(ITEM_DETAIL_TAG);
<<<<<<<
missionProxy.selection.clearSelection();
switch (tools) {
case DRAW:
enableSplineToggle(true);
gestureMapFragment.enableGestureDetection();
break;
case POLY:
enableSplineToggle(false);
Toast.makeText(this,R.string.draw_the_survey_region, Toast.LENGTH_SHORT).show();
gestureMapFragment.enableGestureDetection();
break;
case MARKER:
//Enable the spline selection toggle
enableSplineToggle(true);
gestureMapFragment.disableGestureDetection();
break;
case TRASH:
case NONE:
enableSplineToggle(false);
gestureMapFragment.disableGestureDetection();
break;
}
=======
missionRender.selection.clearSelection();
setupTool(tools);
>>>>>>>
missionProxy.selection.clearSelection();
setupTool(tools);
<<<<<<<
private void addItemDetail(MissionItemProxy item) {
=======
private void addItemDetail(final MissionItemRender item) {
>>>>>>>
private void addItemDetail(MissionItemProxy item) {
<<<<<<<
@Override
public void onWaypointTypeChanged(MissionItemProxy newItem, MissionItemProxy oldItem) {
missionProxy.replace(oldItem, newItem);
=======
@Override
public void onDetailDialogDismissed(MissionItemRender item) {
missionRender.selection.removeItemFromSelection(item);
}
@Override
public void onWaypointTypeChanged(MissionItemRender newItem, MissionItemRender oldItem) {
missionRender.replace(oldItem, newItem);
>>>>>>>
@Override
public void onDetailDialogDismissed(MissionItemProxy item) {
missionProxy.selection.removeItemFromSelection(item);
}
@Override
public void onWaypointTypeChanged(MissionItemProxy newItem, MissionItemProxy oldItem) {
missionProxy.replace(oldItem, newItem);
<<<<<<<
public void onItemClick(MissionItemProxy item) {
switch (editorToolsFragment.getTool()) {
=======
public void onItemClick(MissionItemRender item) {
switch (getTool()) {
>>>>>>>
public void onItemClick(MissionItemProxy item) {
switch (getTool()) { |
<<<<<<<
import org.droidplanner.android.dialogs.openfile.OpenFileDialog;
import org.droidplanner.android.dialogs.openfile.OpenMissionDialog;
import org.droidplanner.android.proxy.mission.MissionSelection;
import org.droidplanner.android.proxy.mission.item.MissionItemProxy;
import org.droidplanner.android.proxy.mission.MissionProxy;
import org.droidplanner.android.utils.prefs.AutoPanMode;
import org.droidplanner.android.utils.file.IO.MissionReader;
import org.droidplanner.android.utils.file.IO.MissionWriter;
import org.droidplanner.core.drone.Drone;
import org.droidplanner.core.drone.DroneInterfaces.DroneEventsType;
=======
import org.droidplanner.android.activities.interfaces.OnEditorInteraction;
import org.droidplanner.android.dialogs.YesNoDialog;
>>>>>>>
import org.droidplanner.android.activities.interfaces.OnEditorInteraction;
import org.droidplanner.android.dialogs.YesNoDialog;
import org.droidplanner.android.dialogs.openfile.OpenFileDialog;
import org.droidplanner.android.dialogs.openfile.OpenMissionDialog; |
<<<<<<<
public void onWaypointsUpdate() {
=======
public void onWaypointsReceived() {
super.onWaypointsReceived();
>>>>>>>
public void onWaypointsUpdate() {
super.onWaypointsUpdate();
<<<<<<<
mapFragment.homeMarker.update(drone);
wpSpinner.updateWpSpinner(drone);
=======
mapFragment.updateHomeToMap(drone);
>>>>>>>
mapFragment.homeMarker.update(drone); |
<<<<<<<
public void onApiConnected(DroidPlannerApi api){
super.onApiConnected(api);
enableSlidingUpPanel(this.dpApi.getDrone());
}
@Override
protected int getNavigationDrawerEntryId() {
return R.id.navigation_flight_data;
=======
public boolean onCreateOptionsMenu(Menu menu){
// Reset the previous info bar
if (infoBar != null) {
infoBar.setDrone(null);
infoBar = null;
}
getMenuInflater().inflate(R.menu.menu_flight_activity, menu);
final MenuItem infoBarItem = menu.findItem(R.id.menu_info_bar);
if (infoBarItem != null)
infoBar = (InfoBarActionProvider) infoBarItem.getActionProvider();
if(drone.getMavClient().isConnected()) {
if (infoBar != null) {
infoBar.setDrone(drone);
}
}
else{
if (infoBar != null) {
infoBar.setDrone(null);
}
}
return super.onCreateOptionsMenu(menu);
>>>>>>>
public void onApiConnected(DroidPlannerApi api){
super.onApiConnected(api);
enableSlidingUpPanel(this.dpApi.getDrone());
}
@Override
public boolean onCreateOptionsMenu(Menu menu){
// Reset the previous info bar
if (infoBar != null) {
infoBar.setDrone(null);
infoBar = null;
}
getMenuInflater().inflate(R.menu.menu_flight_activity, menu);
final MenuItem infoBarItem = menu.findItem(R.id.menu_info_bar);
if (infoBarItem != null)
infoBar = (InfoBarActionProvider) infoBarItem.getActionProvider();
if(drone.getMavClient().isConnected()) {
if (infoBar != null) {
infoBar.setDrone(drone);
}
}
else{
if (infoBar != null) {
infoBar.setDrone(null);
}
}
return super.onCreateOptionsMenu(menu); |
<<<<<<<
import com.MAVLink.Messages.ardupilotmega.msg_global_position_int;
import org.droidplanner.android.R;
import org.droidplanner.android.activities.LocatorActivity;
import org.droidplanner.android.widgets.adapterViews.LocatorItemAdapter;
import it.sephiroth.android.library.widget.AdapterView;
import it.sephiroth.android.library.widget.AdapterView.OnItemClickListener;
import it.sephiroth.android.library.widget.HListView;
=======
import com.MAVLink.common.msg_global_position_int;
>>>>>>>
import org.droidplanner.android.R;
import org.droidplanner.android.activities.LocatorActivity;
import org.droidplanner.android.widgets.adapterViews.LocatorItemAdapter;
import it.sephiroth.android.library.widget.AdapterView;
import it.sephiroth.android.library.widget.AdapterView.OnItemClickListener;
import it.sephiroth.android.library.widget.HListView;
import com.MAVLink.common.msg_global_position_int; |
<<<<<<<
myDrone.onOrientationUpdate();
=======
myDrone.notifyModeChanged();
myDrone.notifyHudUpdate();
>>>>>>>
myDrone.onOrientationUpdate();
myDrone.notifyModeChanged(); |
<<<<<<<
=======
import android.support.v4.app.FragmentManager;
import android.view.Menu;
>>>>>>>
<<<<<<<
=======
import android.view.WindowManager.LayoutParams;
import android.widget.ArrayAdapter;
import android.widget.SpinnerAdapter;
>>>>>>>
<<<<<<<
=======
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.menu_super_activiy, menu);
armButton = menu.findItem(R.id.menu_arm);
connectButton = menu.findItem(R.id.menu_connect);
drone.MavClient.queryConnectionState();
return super.onCreateOptionsMenu(menu);
}
>>>>>>> |
<<<<<<<
public class Waypoint extends SpatialCoordItem implements MarkerSource {
public double delay;
public double acceptanceRadius;
public double yawAngle;
public double orbitalRadius;
public boolean orbitCCW;
=======
public class Waypoint extends GenericWaypoint implements MarkerSource {
private double delay;
private double acceptanceRadius;
private double yawAngle;
private double orbitalRadius;
private boolean orbitCCW;
>>>>>>>
public class Waypoint extends SpatialCoordItem implements MarkerSource {
private double delay;
private double acceptanceRadius;
private double yawAngle;
private double orbitalRadius;
private boolean orbitCCW; |
<<<<<<<
SecurityUtil.serverLogin(SiteConfiguration.getInstance());
VolumeManager fs = VolumeManagerImpl.get();
=======
SecurityUtil.serverLogin(ServerConfiguration.getSiteConfiguration());
>>>>>>>
SecurityUtil.serverLogin(SiteConfiguration.getInstance());
<<<<<<<
Instance instance = HdfsZooInstance.getInstance();
ServerConfigurationFactory conf = new ServerConfigurationFactory(instance);
=======
final String app = "tserver";
Accumulo.setupLogging(app);
final Instance instance = HdfsZooInstance.getInstance();
ServerConfiguration conf = new ServerConfiguration(instance);
VolumeManager fs = VolumeManagerImpl.get();
>>>>>>>
final String app = "tserver";
Accumulo.setupLogging(app);
final Instance instance = HdfsZooInstance.getInstance();
ServerConfigurationFactory conf = new ServerConfigurationFactory(instance);
VolumeManager fs = VolumeManagerImpl.get(); |
<<<<<<<
private final static IntentFilter intentFilter = new IntentFilter();
static {
intentFilter.addAction(Event.EVENT_PARAMETERS_REFRESH_STARTED);
intentFilter.addAction(Event.EVENT_PARAMETERS_REFRESH_ENDED);
intentFilter.addAction(Event.EVENT_PARAMETERS_RECEIVED);
}
private final BroadcastReceiver broadcastReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
final String action = intent.getAction();
if(Event.EVENT_PARAMETERS_REFRESH_STARTED.equals(action)){
startProgress();
}
else if(Event.EVENT_PARAMETERS_REFRESH_ENDED.equals(action)){
if(getDrone().isConnected()) {
loadAdapter(getDrone().getParameters().getParameters());
}
stopProgress();
}
else if(Event.EVENT_PARAMETERS_RECEIVED.equals(action)){
final int defaultValue = -1;
int index = intent.getIntExtra(Extra.EXTRA_PARAMETER_INDEX, defaultValue);
int count = intent.getIntExtra(Extra.EXTRA_PARAMETERS_COUNT, defaultValue);
if(index != defaultValue && count != defaultValue)
updateProgress(index, count);
}
else if(Event.EVENT_DISCONNECTED.equals(action)){
stopProgress();
}
else if(Event.EVENT_TYPE_UPDATED.equals(action)){
if(getDrone().isConnected())
loadAdapter(getDrone().getParameters().getParameters());
}
}
};
=======
private static final String EXTRA_OPENED_PARAMS_FILENAME = "extra_opened_params_filename";
>>>>>>>
private static final String EXTRA_OPENED_PARAMS_FILENAME = "extra_opened_params_filename";
private final static IntentFilter intentFilter = new IntentFilter();
static {
intentFilter.addAction(Event.EVENT_PARAMETERS_REFRESH_STARTED);
intentFilter.addAction(Event.EVENT_PARAMETERS_REFRESH_ENDED);
intentFilter.addAction(Event.EVENT_PARAMETERS_RECEIVED);
}
private final BroadcastReceiver broadcastReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
final String action = intent.getAction();
if(Event.EVENT_PARAMETERS_REFRESH_STARTED.equals(action)){
startProgress();
}
else if(Event.EVENT_PARAMETERS_REFRESH_ENDED.equals(action)){
if(getDrone().isConnected()) {
loadAdapter(getDrone().getParameters().getParameters());
}
stopProgress();
}
else if(Event.EVENT_PARAMETERS_RECEIVED.equals(action)){
final int defaultValue = -1;
int index = intent.getIntExtra(Extra.EXTRA_PARAMETER_INDEX, defaultValue);
int count = intent.getIntExtra(Extra.EXTRA_PARAMETERS_COUNT, defaultValue);
if(index != defaultValue && count != defaultValue)
updateProgress(index, count);
}
else if(Event.EVENT_DISCONNECTED.equals(action)){
stopProgress();
}
else if(Event.EVENT_TYPE_UPDATED.equals(action)){
if(getDrone().isConnected())
loadAdapter(getDrone().getParameters().getParameters());
}
}
};
<<<<<<<
=======
final List<Parameter> parametersList = drone.getParameters().getParametersList();
if(!parametersList.isEmpty()) {
loadAdapter(parametersList, false);
}
>>>>>>>
<<<<<<<
outState.putParcelableArrayList(ADAPTER_ITEMS, pwms);
=======
outState.putSerializable(ADAPTER_ITEMS, pwms);
outState.putString(EXTRA_OPENED_PARAMS_FILENAME, this.openedParamsFilename);
>>>>>>>
outState.putParcelableArrayList(ADAPTER_ITEMS, pwms);
outState.putString(EXTRA_OPENED_PARAMS_FILENAME, this.openedParamsFilename);
<<<<<<<
private void loadAdapter(List<Parameter> parameters){
=======
@Override
public void onBeginReceivingParameters() {
startProgress();
}
@Override
public void onParameterReceived(Parameter parameter, int index, int count) {
updateProgress(index, count);
}
@Override
public void onEndReceivingParameters(List<Parameter> parameters) {
loadAdapter(parameters, false);
stopProgress();
}
private void loadAdapter(List<Parameter> parameters, boolean isUpdate){
>>>>>>>
private void loadAdapter(List<Parameter> parameters, boolean isUpdate){
<<<<<<<
Set<Parameter> prunedParameters = new TreeSet<Parameter>(parameters);
adapter.loadParameters(prunedParameters);
=======
TreeMap<String, Parameter> prunedParameters = new TreeMap<>();
for(Parameter parameter: parameters){
prunedParameters.put(parameter.name, parameter);
}
if(isUpdate){
adapter.updateParameters(prunedParameters);
}
else {
adapter.loadParameters(drone, prunedParameters);
}
>>>>>>>
TreeMap<String, Parameter> prunedParameters = new TreeMap<>();
for(Parameter parameter: parameters){
prunedParameters.put(parameter.name, parameter);
}
if(isUpdate){
adapter.updateParameters(prunedParameters);
}
else {
adapter.loadParameters(prunedParameters);
} |
<<<<<<<
import org.apache.accumulo.core.client.Scanner;
import org.apache.accumulo.core.client.TableNotFoundException;
import org.apache.accumulo.core.data.Key;
import org.apache.accumulo.core.data.Range;
import org.apache.accumulo.core.data.Value;
=======
import org.apache.accumulo.core.conf.AccumuloConfiguration;
import org.apache.accumulo.core.conf.Property;
>>>>>>>
import org.apache.accumulo.core.client.Scanner;
import org.apache.accumulo.core.client.TableNotFoundException;
import org.apache.accumulo.core.conf.AccumuloConfiguration;
import org.apache.accumulo.core.conf.Property;
import org.apache.accumulo.core.data.Key;
import org.apache.accumulo.core.data.Range;
import org.apache.accumulo.core.data.Value;
<<<<<<<
import com.google.common.collect.Iterables;
=======
import com.google.common.annotations.VisibleForTesting;
>>>>>>>
import com.google.common.annotations.VisibleForTesting;
import com.google.common.collect.Iterables;
<<<<<<<
import com.google.protobuf.InvalidProtocolBufferException;
import java.util.concurrent.TimeUnit;
import org.apache.accumulo.core.conf.AccumuloConfiguration;
import org.apache.accumulo.core.conf.Property;
=======
>>>>>>>
import com.google.protobuf.InvalidProtocolBufferException; |
<<<<<<<
import com.mojang.blaze3d.systems.RenderSystem;
=======
import net.minecraft.util.text.ITextComponent;
>>>>>>>
import com.mojang.blaze3d.systems.RenderSystem;
import net.minecraft.util.text.ITextComponent; |
<<<<<<<
public final Screen gui;
public final ResourceLocation book;
=======
public final GuiScreen gui;
>>>>>>>
public final Screen gui;
<<<<<<<
public BookDrawScreenEvent(Screen gui, ResourceLocation book, int mouseX, int mouseY, float partialTicks) {
=======
public BookDrawScreenEvent(GuiScreen gui, ResourceLocation book, int mouseX, int mouseY, float partialTicks) {
super(book);
>>>>>>>
public BookDrawScreenEvent(Screen gui, ResourceLocation book, int mouseX, int mouseY, float partialTicks) {
super(book); |
<<<<<<<
} catch(Exception ex) {
handle(ex);
=======
} catch(Exception e) {
// [RS] WebDAV: error handling
e.printStackTrace();
>>>>>>>
} catch(Exception e) {
handle(ex);
<<<<<<<
public Long getContentLength() {
return null;
}
@Override
=======
>>>>>>>
<<<<<<<
public Long getMaxAgeSeconds(final Auth auth) {
return null;
}
@Override
=======
>>>>>>> |
<<<<<<<
ctx.resources.updates().add(new DBAdd(data, input, ctx, info), ctx);
=======
final Options opts = checkOptions(3, Q_OPTIONS, new Options(), ctx);
ctx.updates.add(new DBAdd(data, input, opts, ctx, info), ctx);
>>>>>>>
final Options opts = checkOptions(3, Q_OPTIONS, new Options(), ctx);
ctx.resources.updates().add(new DBAdd(data, input, opts, ctx, info), ctx);
<<<<<<<
updates.add(new DBAdd(data, input, ctx, info), ctx);
=======
ctx.updates.add(new DBAdd(data, input, opts, ctx, info), ctx);
>>>>>>>
updates.add(new DBAdd(data, input, opts, ctx, info), ctx);
<<<<<<<
ctx.resources.updates().add(new DBCreate(info, name, inputs, opts, ctx), ctx);
=======
ctx.updates.add(new DBCreate(name, inputs, opts, ctx, info), ctx);
>>>>>>>
ctx.resources.updates().add(new DBCreate(name, inputs, opts, ctx, info), ctx); |
<<<<<<<
String doc;
final TokenObjMap<IntList> dirs = new TokenObjMap<IntList>();
for(int pre : prevals) {
doc = string(ctx.data.text(pre, true));
String s = doc.substring(dirpath.length(), doc.length());
int idx = s.lastIndexOf(Prop.DIRSEP);
if(idx == 0) dbs.add(new BXDocument(dbname, s.substring(1, s.length()),
ctx));
=======
for(final int pre : prevals) {
final String doc = string(ctx.data.text(pre, true));
final String s = doc.substring(dirpath.length(), doc.length());
final int idx = s.lastIndexOf(Prop.DIRSEP);
if(idx == 0) dbs.add(new BXDocument(dbname, dirpath.substring(1,
dirpath.length()), ctx));
>>>>>>>
for(final int pre : prevals) {
final String doc = string(ctx.data.text(pre, true));
final String s = doc.substring(dirpath.length(), doc.length());
final int idx = s.lastIndexOf(Prop.DIRSEP);
if(idx == 0) dbs.add(new BXDocument(dbname, s.substring(1,
s.length()), ctx));
<<<<<<<
String[] parts = s.split(Prop.DIRSEP);
byte[] dir = token(dirpath + Prop.DIRSEP + parts[1]);
if(dirs.get(dir) == null) {
IntList l = new IntList();
l.add(pre);
dirs.add(dir, l);
} else {
dirs.get(dir).add(pre);
}
=======
final String[] parts = s.split(Prop.DIRSEP);
final byte[] dir = token(dirpath + Prop.DIRSEP + parts[0]);
if(dirs.get(dir) == null) dirs.add(dir, new IntList());
dirs.get(dir).add(pre);
>>>>>>>
final String[] parts = s.split(Prop.DIRSEP);
final byte[] dir = token(dirpath + Prop.DIRSEP + parts[1]);
if(dirs.get(dir) == null) dirs.add(dir, new IntList());
dirs.get(dir).add(pre); |
<<<<<<<
FElem(final Element elem, final Nod p, final TokenMap nss) {
super(NodeType.ELM);
=======
FElem(final Element elem, final ANode p, final TokenMap nss) {
super(Type.ELM);
>>>>>>>
FElem(final Element elem, final ANode p, final TokenMap nss) {
super(NodeType.ELM); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.