conflict_resolution
stringlengths
27
16k
<<<<<<< * @param predicate determines whether to include class members in results ======= * @param predicate whether to include class members in results * @param publicMembersOnly whether to visit only public members of classes >>>>>>> * @param predicate whether to include class members in results
<<<<<<< public final class MethodCall extends ConcreteOperation implements Operation, Serializable { private static final long serialVersionUID = -7616184807726929835L; ======= public final class MethodCall extends AbstractOperation implements Operation { >>>>>>> public final class MethodCall extends ConcreteOperation implements Operation {
<<<<<<< * Read Toradocu JSON condition file to use Toradocu generated conditions to control how tests are * classified. * * <p>Param-conditions are used as pre-conditions on method/constructor calls, with test sequences * where the condition fails being classified as {@link BehaviorType#INVALID}. * * <p>Throws-conditions are used to check exceptions: if the inputs to the call satisfy the * condition, when the exception is thrown the sequence is {@link BehaviorType#EXPECTED}, but, if * it is not, the sequence is classified as {@link BehaviorType#ERROR}. If the throws-condition is * not satisfied by the input, then ordinary classification is applied. */ @Option("Use Toradocu condition JSON file to classify behaviors for methods/constructors") public static List<File> toradocu_conditions = null; /** * Throw exception when cannot find expected condition methods in Toradocu output. Otherwise a * warning message is printed and the condition is ignored. */ @Unpublicized @Option("Allow failure when cannot find Toradocu condition methods") public static boolean fail_on_condition_input_error = false; /** * File containing side-effect-free observer methods. Specifying observers has two benefits: it ======= * Ignore the situation where a code sequence that previously executed normally throws an * exception when executed as part of a longer test sequence. If true, the sequence will be * classified as invalid. If false, Randoop will halt with information about the sequence to aid * in identifying the issue. * * <p>Use of this option is a last resort. Flaky tests are usually due to calling Randoop on * side-effecting or nondeterministic methods, and a better solution is not to call Randoop on * such methods. */ @Option("Whether to ignore non-determinism in test execution") public static boolean ignore_flaky_tests = false; /** * File containing side-effect-free observer methods. Specifying observers has 2 benefits: it >>>>>>> * Read Toradocu JSON condition file to use Toradocu generated conditions to control how tests are * classified. * * <p>Param-conditions are used as pre-conditions on method/constructor calls, with test sequences * where the condition fails being classified as {@link BehaviorType#INVALID}. * * <p>Throws-conditions are used to check exceptions: if the inputs to the call satisfy the * condition, when the exception is thrown the sequence is {@link BehaviorType#EXPECTED}, but, if * it is not, the sequence is classified as {@link BehaviorType#ERROR}. If the throws-condition is * not satisfied by the input, then ordinary classification is applied. */ @Option("Use Toradocu condition JSON file to classify behaviors for methods/constructors") public static List<File> toradocu_conditions = null; /** * Throw exception when cannot find expected condition methods in Toradocu output. Otherwise a * warning message is printed and the condition is ignored. */ @Unpublicized @Option("Allow failure when cannot find Toradocu condition methods") public static boolean fail_on_condition_input_error = false; /** * File containing side-effect-free observer methods. Specifying observers has 2 benefits: it
<<<<<<< private List<String> toCodeLines() { List<String> lines = new ArrayList<>(); ======= /** * Return this sequence as code. Similar to {@link Sequence#toCodeString()} except includes the * checks. * * <p>If for a given statement there is a check of type {@link randoop.test.ExceptionCheck}, that * check's pre-statement code is printed immediately before the statement, and its post-statement * code is printed immediately after the statement. * * @return the sequence as a string */ public String toCodeString() { StringBuilder b = new StringBuilder(); >>>>>>> /** * Return this sequence as code. Similar to {@link Sequence#toCodeString()} except includes the * checks. * * <p>If for a given statement there is a check of type {@link randoop.test.ExceptionCheck}, that * check's pre-statement code is printed immediately before the statement, and its post-statement * code is printed immediately after the statement. * * @return the sequence as a string */ private List<String> toCodeLines() { List<String> lines = new ArrayList<>();
<<<<<<< private static final Logger log = Logger.getLogger(TableOperationsImpl.class); ======= private static final Logger log = Logger.getLogger(TableOperations.class); private static final Charset utf8 = Charset.forName("UTF8"); >>>>>>> private static final Logger log = Logger.getLogger(TableOperationsImpl.class); private static final Charset utf8 = Charset.forName("UTF8");
<<<<<<< try (Scanner s = conn.createScanner("foo", Authorizations.EMPTY)) { Assert.assertEquals(0, Iterables.size(s)); ZooReader zreader = new ZooReader(context.getZooKeepers(), context.getZooKeepersSessionTimeOut()); Set<String> tserverHost = new HashSet<>(); tserverHost .addAll(zreader.getChildren(ZooUtil.getRoot(conn.getInstanceID()) + Constants.ZTSERVERS)); Set<HostAndPort> replicationServices = new HashSet<>(); for (String tserver : tserverHost) { try { byte[] portData = zreader.getData(ZooUtil.getRoot(conn.getInstanceID()) + ReplicationConstants.ZOO_TSERVERS + "/" + tserver, null); HostAndPort replAddress = HostAndPort.fromString(new String(portData, UTF_8)); replicationServices.add(replAddress); } catch (Exception e) { log.error("Could not find port for {}", tserver, e); Assert.fail("Did not find replication port advertisement for " + tserver); } ======= Scanner s = conn.createScanner("foo", Authorizations.EMPTY); assertEquals(0, Iterables.size(s)); ZooReader zreader = new ZooReader(inst.getZooKeepers(), inst.getZooKeepersSessionTimeOut()); Set<String> tserverHost = new HashSet<>(); tserverHost.addAll(zreader.getChildren(ZooUtil.getRoot(inst) + Constants.ZTSERVERS)); Set<HostAndPort> replicationServices = new HashSet<>(); for (String tserver : tserverHost) { try { byte[] portData = zreader.getData( ZooUtil.getRoot(inst) + ReplicationConstants.ZOO_TSERVERS + "/" + tserver, null); HostAndPort replAddress = HostAndPort.fromString(new String(portData, UTF_8)); replicationServices.add(replAddress); } catch (Exception e) { log.error("Could not find port for {}", tserver, e); fail("Did not find replication port advertisement for " + tserver); >>>>>>> try (Scanner s = conn.createScanner("foo", Authorizations.EMPTY)) { assertEquals(0, Iterables.size(s)); ZooReader zreader = new ZooReader(context.getZooKeepers(), context.getZooKeepersSessionTimeOut()); Set<String> tserverHost = new HashSet<>(); tserverHost .addAll(zreader.getChildren(ZooUtil.getRoot(conn.getInstanceID()) + Constants.ZTSERVERS)); Set<HostAndPort> replicationServices = new HashSet<>(); for (String tserver : tserverHost) { try { byte[] portData = zreader.getData(ZooUtil.getRoot(conn.getInstanceID()) + ReplicationConstants.ZOO_TSERVERS + "/" + tserver, null); HostAndPort replAddress = HostAndPort.fromString(new String(portData, UTF_8)); replicationServices.add(replAddress); } catch (Exception e) { log.error("Could not find port for {}", tserver, e); fail("Did not find replication port advertisement for " + tserver); } <<<<<<< // Each tserver should also have equal replication services running internally Assert.assertEquals("Expected an equal number of replication servicers and tservers", tserverHost.size(), replicationServices.size()); } ======= // Each tserver should also have equial replicaiton services running internally assertEquals("Expected an equal number of replication servicers and tservers", tserverHost.size(), replicationServices.size()); >>>>>>> // Each tserver should also have equal replication services running internally assertEquals("Expected an equal number of replication servicers and tservers", tserverHost.size(), replicationServices.size()); } <<<<<<< try (Scanner s = conn.createScanner("foo", Authorizations.EMPTY)) { Assert.assertEquals(0, Iterables.size(s)); ======= Scanner s = conn.createScanner("foo", Authorizations.EMPTY); assertEquals(0, Iterables.size(s)); >>>>>>> try (Scanner s = conn.createScanner("foo", Authorizations.EMPTY)) { assertEquals(0, Iterables.size(s)); <<<<<<< // Should have one master instance Assert.assertEquals(1, context.getMasterLocations().size()); ======= // Should have one master instance assertEquals(1, inst.getMasterLocations().size()); >>>>>>> // Should have one master instance assertEquals(1, context.getMasterLocations().size());
<<<<<<< ======= import java.security.InvalidParameterException; >>>>>>> <<<<<<< import javax.inject.Inject; import org.n52.faroe.annotation.Configurable; import org.n52.faroe.annotation.Setting; import org.n52.shetland.ogc.filter.FilterConstants.TimeOperator; import org.n52.shetland.ogc.filter.TemporalFilter; import org.n52.shetland.ogc.gml.time.TimeInstant; import org.n52.shetland.ogc.ows.exception.CompositeOwsException; import org.n52.shetland.ogc.ows.exception.OwsExceptionReport; import org.n52.shetland.ogc.sos.ExtendedIndeterminateTime; import org.n52.shetland.ogc.sos.Sos2Constants; import org.n52.shetland.ogc.sos.SosConstants; import org.n52.shetland.ogc.sos.exception.ResponseExceedsSizeLimitException; import org.n52.shetland.ogc.sos.request.GetObservationRequest; import org.n52.shetland.ogc.sos.response.GetObservationResponse; import org.n52.shetland.ogc.swe.simpleType.SweBoolean; import org.n52.shetland.ogc.swes.SwesExtension; import org.n52.shetland.ogc.swes.SwesExtensions; import org.n52.shetland.util.CollectionHelper; import org.n52.sos.coding.encode.ResponseFormatRepository; import org.n52.sos.ds.AbstractGetObservationHandler; ======= import org.n52.sos.coding.CodingRepository; import org.n52.sos.config.annotation.Configurable; import org.n52.sos.config.annotation.Setting; import org.n52.sos.ds.AbstractGetObservationDAO; import org.n52.sos.exception.ows.CodedOwsException; import org.n52.sos.exception.ows.InvalidParameterValueException; import org.n52.sos.exception.ows.MissingParameterValueException; >>>>>>> import javax.inject.Inject; import org.n52.faroe.annotation.Configurable; import org.n52.faroe.annotation.Setting; import org.n52.shetland.ogc.filter.FilterConstants.TimeOperator; import org.n52.shetland.ogc.SupportedType; import org.n52.shetland.ogc.filter.TemporalFilter; import org.n52.shetland.ogc.gml.time.TimeInstant; import org.n52.shetland.ogc.om.ObservationType; import org.n52.shetland.ogc.ows.exception.CompositeOwsException; import org.n52.shetland.ogc.ows.exception.InvalidParameterValueException; import org.n52.shetland.ogc.ows.exception.MissingParameterValueException; import org.n52.shetland.ogc.ows.exception.OwsExceptionReport; import org.n52.shetland.ogc.sos.ExtendedIndeterminateTime; import org.n52.shetland.ogc.sos.Sos2Constants; import org.n52.shetland.ogc.sos.SosConstants; import org.n52.shetland.ogc.sos.exception.ResponseExceedsSizeLimitException; import org.n52.shetland.ogc.sos.request.GetObservationRequest; import org.n52.shetland.ogc.sos.response.GetObservationResponse; import org.n52.shetland.ogc.swe.simpleType.SweBoolean; import org.n52.shetland.ogc.swes.SwesExtension; import org.n52.shetland.ogc.swes.SwesExtensions; import org.n52.shetland.util.CollectionHelper; import org.n52.sos.coding.encode.ResponseFormatRepository; import org.n52.sos.ds.AbstractGetObservationHandler; <<<<<<< ======= import org.n52.sos.exception.sos.ResponseExceedsSizeLimitException; import org.n52.sos.ogc.filter.ComparisonFilter; import org.n52.sos.ogc.filter.FilterConstants.TimeOperator; import org.n52.sos.ogc.filter.TemporalFilter; import org.n52.sos.ogc.gml.time.TimeInstant; import org.n52.sos.ogc.om.OmConstants; import org.n52.sos.ogc.ows.CompositeOwsException; import org.n52.sos.ogc.ows.OwsExceptionReport; import org.n52.sos.ogc.sos.ConformanceClasses; import org.n52.sos.ogc.sos.ResultFilter; import org.n52.sos.ogc.sos.ResultFilterConstants; import org.n52.sos.ogc.sos.Sos2Constants; import org.n52.sos.ogc.sos.SosConstants; import org.n52.sos.ogc.sos.SosConstants.SosIndeterminateTime; import org.n52.sos.ogc.swe.simpleType.SweBoolean; import org.n52.sos.ogc.swes.SwesExtension; import org.n52.sos.ogc.swes.SwesExtensionImpl; import org.n52.sos.ogc.swes.SwesExtensions; import org.n52.sos.request.GetObservationRequest; import org.n52.sos.response.GetObservationResponse; import org.n52.sos.service.Configurator; import org.n52.sos.util.CollectionHelper; >>>>>>> <<<<<<< protected void checkParameters(GetObservationRequest sosRequest) throws OwsExceptionReport { ======= protected void checkParameters(final GetObservationRequest request) throws OwsExceptionReport { >>>>>>> protected void checkParameters(GetObservationRequest request) throws OwsExceptionReport {
<<<<<<< for (String tf : TESTS) { ret.add(new Object[] { new File(BASE_DIR, tf), DEFAULT_ADAPTER, "default", JavaScriptTest.NODE_VERSION_10 }); ret.add(new Object[] { new File(BASE_DIR, tf), DEFAULT_ADAPTER, "default", JavaScriptTest.NODE_VERSION_12 }); ======= String rb = System.getProperty("runBenchmarks"); if ((rb != null) && Boolean.valueOf(rb)) { for (String tf : TESTS) { ret.add(new Object[] { new File(BASE_DIR, tf), DEFAULT_ADAPTER, "default" }); } >>>>>>> for (String tf : TESTS) { ret.add(new Object[] { new File(BASE_DIR, tf), DEFAULT_ADAPTER, "default", JavaScriptTest.NODE_VERSION_10 }); ret.add(new Object[] { new File(BASE_DIR, tf), DEFAULT_ADAPTER, "default", JavaScriptTest.NODE_VERSION_12 }); <<<<<<< System.out.println("Benchmark: " + fileName.getName() + " (" + nodeVersion + ')'); OutputStream rw = JavaScriptTest.NODE_VERSION_10.equals(nodeVersion) ? resultWriter10 : resultWriter12; int exitCode = launchTest(TEST_TIMEOUT, rw, false); ======= System.out.println("Benchmark: " + fileName.getName()); int exitCode = launchTest(TEST_TIMEOUT, resultWriter, false, true); >>>>>>> System.out.println("Benchmark: " + fileName.getName() + " (" + nodeVersion + ')'); OutputStream rw = JavaScriptTest.NODE_VERSION_10.equals(nodeVersion) ? resultWriter10 : resultWriter12; int exitCode = launchTest(TEST_TIMEOUT, rw, false, true);
<<<<<<< import com.corundumstudio.socketio.utils.ConcurrentHashSet; ======= import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.core.JsonParseException; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.Version; import com.fasterxml.jackson.databind.DeserializationContext; import com.fasterxml.jackson.databind.JsonMappingException; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.deser.std.StdDeserializer; import com.fasterxml.jackson.databind.module.SimpleModule; import com.fasterxml.jackson.databind.node.ObjectNode; >>>>>>> import com.corundumstudio.socketio.utils.ConcurrentHashSet; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.core.JsonParseException; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.Version; import com.fasterxml.jackson.databind.DeserializationContext; import com.fasterxml.jackson.databind.JsonMappingException; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.deser.std.StdDeserializer; import com.fasterxml.jackson.databind.module.SimpleModule; import com.fasterxml.jackson.databind.node.ObjectNode;
<<<<<<< import java.net.URL; import java.util.jar.JarFile; ======= import java.io.InputStream; import java.io.InputStreamReader; import java.io.Reader; import java.net.MalformedURLException; import java.net.URL; import java.util.logging.Level; import org.apidesign.vm4brwsr.Bck2Brwsr; >>>>>>> import java.io.InputStream; import java.io.InputStreamReader; import java.io.Reader; import java.net.MalformedURLException; import java.net.URL; import java.util.jar.JarFile; import java.util.logging.Level; import org.apidesign.vm4brwsr.Bck2Brwsr; <<<<<<< CompileCP.compileVM(sb, loader); ======= class R implements Bck2Brwsr.Resources { @Override public InputStream get(String resource) throws IOException { return loader.get(resource, 0); } } String b2b = System.getProperty("bck2brwsr.js"); if (b2b != null) { LOG.log(Level.INFO, "Serving bck2brwsr.js from {0}", b2b); URL bu; try { bu = new URL(b2b); } catch (MalformedURLException ex) { File f = new File(b2b); if (f.exists()) { bu = f.toURI().toURL(); } else { throw ex; } } try (Reader r = new InputStreamReader(bu.openStream())) { char[] arr = new char[4096]; for (;;) { int len = r.read(arr); if (len == -1) { break; } sb.append(arr, 0, len); } } } else { LOG.log(Level.INFO, "Generating bck2brwsr.js from scratch", b2b); Bck2Brwsr.generate(sb, new R()); } >>>>>>> String b2b = System.getProperty("bck2brwsr.js"); if (b2b != null) { LOG.log(Level.INFO, "Serving bck2brwsr.js from {0}", b2b); URL bu; try { bu = new URL(b2b); } catch (MalformedURLException ex) { File f = new File(b2b); if (f.exists()) { bu = f.toURI().toURL(); } else { throw ex; } } try (Reader r = new InputStreamReader(bu.openStream())) { char[] arr = new char[4096]; for (;;) { int len = r.read(arr); if (len == -1) { break; } sb.append(arr, 0, len); } } } else { LOG.log(Level.INFO, "Generating bck2brwsr.js from scratch", b2b); CompileCP.compileVM(sb, loader); } <<<<<<< + " if (request.status !== 200) return null;\n" + " var arr = eval(request.responseText);\n" ======= + " if (request.status !== 200) {\n" + " c[skip] = null;\n" + " return null;\n" + " }\n" + " var arr = eval('(' + request.responseText + ')');\n" + " c[skip] = arr;\n" >>>>>>> + " if (request.status !== 200) {\n" + " c[skip] = null;\n" + " return null;\n" + " }\n" + " var arr = eval(request.responseText);\n" + " c[skip] = arr;\n"
<<<<<<< import org.apidesign.bck2brwsr.core.Exported; ======= >>>>>>> import org.apidesign.bck2brwsr.core.Exported; <<<<<<< ======= Resources r = res != null ? res : new LdrRsrcs(Bck2Brwsr.class.getClassLoader(), false); >>>>>>>
<<<<<<< returnType[0] = '['; sig.insert(firstPos, 'A'); } else { returnType[0] = ch; ======= sig.insert(firstPos, "_3"); >>>>>>> returnType[0] = '['; sig.insert(firstPos, "_3"); } else { returnType[0] = ch; <<<<<<< countArgs(findDescriptor(descr), returnType, name, cnt); ======= countArgs(descr, hasReturn, name, cnt); >>>>>>> countArgs(descr, returnType, name, cnt); <<<<<<< private static int constantToVariableType(final byte constantTag) { switch (constantTag) { case CONSTANT_INTEGER: return Variable.TYPE_INT; case CONSTANT_FLOAT: return Variable.TYPE_FLOAT; case CONSTANT_LONG: return Variable.TYPE_LONG; case CONSTANT_DOUBLE: return Variable.TYPE_DOUBLE; case CONSTANT_CLASS: case CONSTANT_UTF8: case CONSTANT_UNICODE: case CONSTANT_STRING: return Variable.TYPE_REF; case CONSTANT_FIELD: case CONSTANT_METHOD: case CONSTANT_INTERFACEMETHOD: case CONSTANT_NAMEANDTYPE: /* unclear how to handle for now */ default: throw new IllegalStateException("Unhandled constant tag"); } } private static int fieldToVariableType(final char fieldType) { switch (fieldType) { case 'B': case 'C': case 'S': case 'Z': case 'I': return Variable.TYPE_INT; case 'J': return Variable.TYPE_LONG; case 'F': return Variable.TYPE_FLOAT; case 'D': return Variable.TYPE_DOUBLE; case 'L': case '[': return Variable.TYPE_REF; default: throw new IllegalStateException("Unhandled field type"); } } ======= private static void generateAnno(ClassData cd, final Appendable out, byte[] data) throws IOException { AnnotationParser ap = new AnnotationParser(true) { int anno; int cnt; @Override protected void visitAnnotationStart(String type) throws IOException { if (anno++ > 0) { out.append(","); } out.append('"').append(type).append("\" : {\n"); cnt = 0; } @Override protected void visitAnnotationEnd(String type) throws IOException { out.append("\n}\n"); } @Override protected void visitAttr(String type, String attr, String attrType, String value) throws IOException { if (attr == null) { return; } if (cnt++ > 0) { out.append(",\n"); } out.append(attr).append("__").append(attrType).append(" : ").append(value); } }; ap.parse(data, cd); } >>>>>>> private static void generateAnno(ClassData cd, final Appendable out, byte[] data) throws IOException { AnnotationParser ap = new AnnotationParser(true) { int anno; int cnt; @Override protected void visitAnnotationStart(String type) throws IOException { if (anno++ > 0) { out.append(","); } out.append('"').append(type).append("\" : {\n"); cnt = 0; } @Override protected void visitAnnotationEnd(String type) throws IOException { out.append("\n}\n"); } @Override protected void visitAttr(String type, String attr, String attrType, String value) throws IOException { if (attr == null) { return; } if (cnt++ > 0) { out.append(",\n"); } out.append(attr).append("__").append(attrType).append(" : ").append(value); } }; ap.parse(data, cd); } private static int constantToVariableType(final byte constantTag) { switch (constantTag) { case CONSTANT_INTEGER: return Variable.TYPE_INT; case CONSTANT_FLOAT: return Variable.TYPE_FLOAT; case CONSTANT_LONG: return Variable.TYPE_LONG; case CONSTANT_DOUBLE: return Variable.TYPE_DOUBLE; case CONSTANT_CLASS: case CONSTANT_UTF8: case CONSTANT_UNICODE: case CONSTANT_STRING: return Variable.TYPE_REF; case CONSTANT_FIELD: case CONSTANT_METHOD: case CONSTANT_INTERFACEMETHOD: case CONSTANT_NAMEANDTYPE: /* unclear how to handle for now */ default: throw new IllegalStateException("Unhandled constant tag"); } } private static int fieldToVariableType(final char fieldType) { switch (fieldType) { case 'B': case 'C': case 'S': case 'Z': case 'I': return Variable.TYPE_INT; case 'J': return Variable.TYPE_LONG; case 'F': return Variable.TYPE_FLOAT; case 'D': return Variable.TYPE_DOUBLE; case 'L': case '[': return Variable.TYPE_REF; default: throw new IllegalStateException("Unhandled field type"); } }
<<<<<<< try { GenJS.compile(w, classes); } finally { w.close(); } ======= Bck2Brwsr.generate(w, Main.class.getClassLoader(), classes.toArray()); w.close(); >>>>>>> try { Bck2Brwsr.generate(w, Main.class.getClassLoader(), classes.toArray()); } finally { w.close(); }
<<<<<<< import java.io.FileOutputStream; import java.io.IOException; import java.io.RandomAccessFile; import java.nio.channels.FileChannel; import java.nio.channels.FileLock; ======= import java.io.IOException; >>>>>>> import java.io.FileOutputStream; import java.io.IOException; import java.io.RandomAccessFile; import java.nio.channels.FileChannel; import java.nio.channels.FileLock; <<<<<<< protected final FileChannel lockFileChannel; protected AtomicInteger readLockCount = new AtomicInteger(0); ======= private File largeValuesRoot; >>>>>>> protected final FileChannel lockFileChannel; protected AtomicInteger readLockCount = new AtomicInteger(0); private File largeValuesRoot; <<<<<<< if (!repositoryRoot.exists()) repositoryRoot.mkdir(); File repositoryLockFile = null; FileChannel lfc = null; if (source.isLockFileUsed()) { repositoryLockFile = new File(repositoryRoot, LOCK_FILE_NAME); try { if (!repositoryLockFile.exists()) { FileOutputStream fos = null; fos = new FileOutputStream(repositoryLockFile); fos.write("modeshape".getBytes()); fos.close(); } RandomAccessFile raf = new RandomAccessFile(repositoryLockFile, "rw"); lfc = raf.getChannel(); } catch (IOException ioe) { LOGGER.warn(ioe, DiskConnectorI18n.couldNotCreateLockFile, source.getName()); } } this.lockFileChannel = lfc; ======= if (!repositoryRoot.exists()) repositoryRoot.mkdirs(); assert repositoryRoot.exists(); largeValuesRoot = new File(repositoryRoot, source.getLargeValuePath()); if (!largeValuesRoot.exists()) largeValuesRoot.mkdirs(); assert largeValuesRoot.exists(); >>>>>>> if (!repositoryRoot.exists()) repositoryRoot.mkdir(); File repositoryLockFile = null; FileChannel lfc = null; if (source.isLockFileUsed()) { repositoryLockFile = new File(repositoryRoot, LOCK_FILE_NAME); try { if (!repositoryLockFile.exists()) { FileOutputStream fos = null; fos = new FileOutputStream(repositoryLockFile); fos.write("modeshape".getBytes()); fos.close(); } RandomAccessFile raf = new RandomAccessFile(repositoryLockFile, "rw"); lfc = raf.getChannel(); } catch (IOException ioe) { LOGGER.warn(ioe, DiskConnectorI18n.couldNotCreateLockFile, source.getName()); } } this.lockFileChannel = lfc; if (!repositoryRoot.exists()) repositoryRoot.mkdirs(); assert repositoryRoot.exists(); largeValuesRoot = new File(repositoryRoot, source.getLargeValuePath()); if (!largeValuesRoot.exists()) largeValuesRoot.mkdirs(); assert largeValuesRoot.exists(); <<<<<<< interface DiskLock { void lock(); void unlock(); } class DiskBackedReadLock implements DiskLock { private final Lock lock; private FileLock fileLock = null; public DiskBackedReadLock( ReadWriteLock lock ) { super(); this.lock = lock.readLock(); } public void lock() { this.lock.lock(); if (lockFileChannel != null) { /* * FileLocks are held on behalf of the entire JVM and are not reentrant (at least on OS X), so we * need to track how many open read locks exist within this JVM. If anyone knows a good Java implementation * of a counting semaphore, that could be used instead. */ try { synchronized (DiskRepository.this) { int count = readLockCount.get(); assert count >= 0; if (count == 0) { fileLock = lockFileChannel.lock(0, 1, true); } readLockCount.getAndIncrement(); } } catch (Throwable t) { this.lock.unlock(); I18n msg = DiskConnectorI18n.problemAcquiringFileLock; throw new IllegalStateException(msg.text(DiskRepository.this.getSourceName()), t); } } } public void unlock() { try { if (fileLock != null) { synchronized (DiskRepository.this) { int count = readLockCount.getAndDecrement(); assert count >= 0; if (readLockCount.get() == 0) { try { fileLock.release(); } catch (IOException ioe) { LOGGER.warn(ioe, DiskConnectorI18n.problemReleasingFileLock, getSourceName()); } } } } } finally { lock.unlock(); } } } class DiskBackedWriteLock implements DiskLock { private final Lock lock; private FileLock fileLock; public DiskBackedWriteLock( ReadWriteLock lock ) { super(); this.lock = lock.writeLock(); } public void lock() { this.lock.lock(); if (lockFileChannel != null) { try { fileLock = lockFileChannel.lock(0, 1, false); } catch (Throwable t) { this.lock.unlock(); I18n msg = DiskConnectorI18n.problemAcquiringFileLock; throw new IllegalStateException(msg.text(DiskRepository.this.getSourceName()), t); } } } public void unlock() { try { if (fileLock != null) { try { fileLock.release(); } catch (IOException ioe) { LOGGER.warn(ioe, DiskConnectorI18n.problemReleasingFileLock, getSourceName()); } } } finally { this.lock.unlock(); } } } ======= DiskSource diskSource() { return this.diskSource; } File largeValuesRoot() { return this.largeValuesRoot; } >>>>>>> DiskSource diskSource() { return this.diskSource; } File largeValuesRoot() { return this.largeValuesRoot; } interface DiskLock { void lock(); void unlock(); } class DiskBackedReadLock implements DiskLock { private final Lock lock; private FileLock fileLock = null; public DiskBackedReadLock( ReadWriteLock lock ) { super(); this.lock = lock.readLock(); } public void lock() { this.lock.lock(); if (lockFileChannel != null) { /* * FileLocks are held on behalf of the entire JVM and are not reentrant (at least on OS X), so we * need to track how many open read locks exist within this JVM. If anyone knows a good Java implementation * of a counting semaphore, that could be used instead. */ try { synchronized (DiskRepository.this) { int count = readLockCount.get(); assert count >= 0; if (count == 0) { fileLock = lockFileChannel.lock(0, 1, true); } readLockCount.getAndIncrement(); } } catch (Throwable t) { this.lock.unlock(); I18n msg = DiskConnectorI18n.problemAcquiringFileLock; throw new IllegalStateException(msg.text(DiskRepository.this.getSourceName()), t); } } } public void unlock() { try { if (fileLock != null) { synchronized (DiskRepository.this) { int count = readLockCount.getAndDecrement(); assert count >= 0; if (readLockCount.get() == 0) { try { fileLock.release(); } catch (IOException ioe) { LOGGER.warn(ioe, DiskConnectorI18n.problemReleasingFileLock, getSourceName()); } } } } } finally { lock.unlock(); } } } class DiskBackedWriteLock implements DiskLock { private final Lock lock; private FileLock fileLock; public DiskBackedWriteLock( ReadWriteLock lock ) { super(); this.lock = lock.writeLock(); } public void lock() { this.lock.lock(); if (lockFileChannel != null) { try { fileLock = lockFileChannel.lock(0, 1, false); } catch (Throwable t) { this.lock.unlock(); I18n msg = DiskConnectorI18n.problemAcquiringFileLock; throw new IllegalStateException(msg.text(DiskRepository.this.getSourceName()), t); } } } public void unlock() { try { if (fileLock != null) { try { fileLock.release(); } catch (IOException ioe) { LOGGER.warn(ioe, DiskConnectorI18n.problemReleasingFileLock, getSourceName()); } } } finally { this.lock.unlock(); } } }
<<<<<<< ======= import static org.modeshape.jcr.api.observation.Event.Sequencing.NODE_SEQUENCED; import static org.modeshape.jcr.api.observation.Event.Sequencing.NODE_SEQUENCING_FAILURE; import static org.modeshape.jcr.api.observation.Event.Sequencing.OUTPUT_PATH; import static org.modeshape.jcr.api.observation.Event.Sequencing.SELECTED_PATH; import static org.modeshape.jcr.api.observation.Event.Sequencing.SEQUENCED_NODE_ID; import static org.modeshape.jcr.api.observation.Event.Sequencing.SEQUENCED_NODE_PATH; import static org.modeshape.jcr.api.observation.Event.Sequencing.SEQUENCER_NAME; import static org.modeshape.jcr.api.observation.Event.Sequencing.SEQUENCING_FAILURE_CAUSE; import static org.modeshape.jcr.api.observation.Event.Sequencing.USER_ID; >>>>>>> <<<<<<< Map<String, String> infoMap = new HashMap<String, String>(); infoMap.put(SEQUENCED_NODE_PATH, stringFor(sequencedChange.getSequencedNodePath())); infoMap.put(SEQUENCED_NODE_ID, sequencedChange.getSequencedNodeKey().toString()); events.add(new JcrEvent(bundle, NODE_SEQUENCED, stringFor(sequencedChange.getPath()), nodeId, infoMap)); ======= Map<String, Object> infoMap = createEventInfoMapForSequencerChange(sequencedChange); events.add(new JcrEvent(bundle, NODE_SEQUENCED, stringFor(sequencedChange.getOutputNodePath()), sequencedChange.getOutputNodeKey().toString(), infoMap)); } else if (nodeChange instanceof NodeSequencingFailure && eventListenedFor(NODE_SEQUENCING_FAILURE)) { //create event for the sequencing failure NodeSequencingFailure sequencingFailure = (NodeSequencingFailure) nodeChange; Map<String, Object> infoMap = createEventInfoMapForSequencerChange(sequencingFailure); infoMap.put(SEQUENCING_FAILURE_CAUSE, sequencingFailure.getCause()); events.add(new JcrEvent(bundle, NODE_SEQUENCING_FAILURE, stringFor(sequencingFailure.getPath()), nodeId, infoMap)); >>>>>>> Map<String, Object> infoMap = createEventInfoMapForSequencerChange(sequencedChange); events.add(new JcrEvent(bundle, NODE_SEQUENCED, stringFor(sequencedChange.getOutputNodePath()), sequencedChange.getOutputNodeKey().toString(), infoMap)); } else if (nodeChange instanceof NodeSequencingFailure && eventListenedFor(NODE_SEQUENCING_FAILURE)) { //create event for the sequencing failure NodeSequencingFailure sequencingFailure = (NodeSequencingFailure) nodeChange; Map<String, Object> infoMap = createEventInfoMapForSequencerChange(sequencingFailure); infoMap.put(SEQUENCING_FAILURE_CAUSE, sequencingFailure.getCause()); events.add(new JcrEvent(bundle, NODE_SEQUENCING_FAILURE, stringFor(sequencingFailure.getPath()), nodeId, infoMap));
<<<<<<< import org.modeshape.jcr.value.binary.BinaryUsageChangeSetListener; import org.modeshape.jcr.value.binary.InfinispanBinaryStore; ======= import org.modeshape.jcr.value.binary.infinispan.InfinispanBinaryStore; import org.modeshape.jcr.value.binary.UnusedBinaryChangeSetListener; >>>>>>> import org.modeshape.jcr.value.binary.BinaryUsageChangeSetListener; import org.modeshape.jcr.value.binary.infinispan.InfinispanBinaryStore;
<<<<<<< /** * The initial value for whether a lock file is used is "{@value} ", unless otherwise specified. */ public static final boolean DEFAULT_LOCK_FILE_USED = false; ======= /** * The initial value for the large value threshold is "{@value} ", unless otherwise specified. */ private static final int DEFAULT_LARGE_VALUE_SIZE_IN_BYTES = 1 << 13; // 8 kilobytes /** * The initial path to the large values directory (relative to the repository root path) is "{@value} ", unless otherwise * specified. */ private static final String DEFAULT_LARGE_VALUE_PATH = "largeValues"; >>>>>>> /** * The initial value for whether a lock file is used is "{@value} ", unless otherwise specified. */ public static final boolean DEFAULT_LOCK_FILE_USED = false; /** * The initial value for the large value threshold is "{@value} ", unless otherwise specified. */ private static final int DEFAULT_LARGE_VALUE_SIZE_IN_BYTES = 1 << 13; // 8 kilobytes /** * The initial path to the large values directory (relative to the repository root path) is "{@value} ", unless otherwise * specified. */ private static final String DEFAULT_LARGE_VALUE_PATH = "largeValues"; <<<<<<< private static final String LOCK_FILE_USED = "lockFileUsed"; ======= private static final String LARGE_VALUE_SIZE_IN_BYTES = "largeValueSizeInBytes"; private static final String LARGE_VALUE_PATH = "largeValuePath"; >>>>>>> private static final String LOCK_FILE_USED = "lockFileUsed"; private static final String LARGE_VALUE_SIZE_IN_BYTES = "largeValueSizeInBytes"; private static final String LARGE_VALUE_PATH = "largeValuePath"; <<<<<<< @Description( i18n = DiskConnectorI18n.class, value = "lockFileUsedPropertyDescription" ) @Label( i18n = DiskConnectorI18n.class, value = "lockFileUsedPropertyLabel" ) @Category( i18n = DiskConnectorI18n.class, value = "lockFileUsedPropertyCategory" ) private volatile boolean lockFileUsed = DEFAULT_LOCK_FILE_USED; ======= @Description( i18n = DiskConnectorI18n.class, value = "largeValueSizeInBytesPropertyDescription" ) @Label( i18n = DiskConnectorI18n.class, value = "largeValueSizeInBytesPropertyLabel" ) @Category( i18n = DiskConnectorI18n.class, value = "largeValueSizeInBytesPropertyCategory" ) private volatile long largeValueSizeInBytes = DEFAULT_LARGE_VALUE_SIZE_IN_BYTES; @Description( i18n = DiskConnectorI18n.class, value = "largeValuePathPropertyDescription" ) @Label( i18n = DiskConnectorI18n.class, value = "largeValuePathPropertyLabel" ) @Category( i18n = DiskConnectorI18n.class, value = "largeValuePathPropertyCategory" ) private volatile String largeValuePath = DEFAULT_LARGE_VALUE_PATH; >>>>>>> @Description( i18n = DiskConnectorI18n.class, value = "lockFileUsedPropertyDescription" ) @Label( i18n = DiskConnectorI18n.class, value = "lockFileUsedPropertyLabel" ) @Category( i18n = DiskConnectorI18n.class, value = "lockFileUsedPropertyCategory" ) private volatile boolean lockFileUsed = DEFAULT_LOCK_FILE_USED; @Description( i18n = DiskConnectorI18n.class, value = "largeValueSizeInBytesPropertyDescription" ) @Label( i18n = DiskConnectorI18n.class, value = "largeValueSizeInBytesPropertyLabel" ) @Category( i18n = DiskConnectorI18n.class, value = "largeValueSizeInBytesPropertyCategory" ) private volatile long largeValueSizeInBytes = DEFAULT_LARGE_VALUE_SIZE_IN_BYTES; @Description( i18n = DiskConnectorI18n.class, value = "largeValuePathPropertyDescription" ) @Label( i18n = DiskConnectorI18n.class, value = "largeValuePathPropertyLabel" ) @Category( i18n = DiskConnectorI18n.class, value = "largeValuePathPropertyCategory" ) private volatile String largeValuePath = DEFAULT_LARGE_VALUE_PATH; <<<<<<< ref.add(new StringRefAddr(LOCK_FILE_USED, Boolean.toString(isLockFileUsed()))); ======= ref.add(new StringRefAddr(LARGE_VALUE_SIZE_IN_BYTES, String.valueOf(largeValueSizeInBytes))); ref.add(new StringRefAddr(LARGE_VALUE_PATH, largeValuePath)); >>>>>>> ref.add(new StringRefAddr(LOCK_FILE_USED, Boolean.toString(isLockFileUsed()))); ref.add(new StringRefAddr(LARGE_VALUE_SIZE_IN_BYTES, String.valueOf(largeValueSizeInBytes))); ref.add(new StringRefAddr(LARGE_VALUE_PATH, largeValuePath)); <<<<<<< String lockFileUsed = (String)values.get(LOCK_FILE_USED); ======= String largeValuePath = (String)values.get(LARGE_VALUE_PATH); String largeValueSizeInBytes = (String)values.get(LARGE_VALUE_SIZE_IN_BYTES); >>>>>>> String lockFileUsed = (String)values.get(LOCK_FILE_USED); String largeValuePath = (String)values.get(LARGE_VALUE_PATH); String largeValueSizeInBytes = (String)values.get(LARGE_VALUE_SIZE_IN_BYTES); <<<<<<< if (lockFileUsed != null) source.setLockFileUsed(Boolean.valueOf(lockFileUsed)); ======= if (largeValuePath != null) source.setLargeValuePath(largeValuePath); if (largeValueSizeInBytes != null) source.setLargeValueSizeInBytes(Long.valueOf(largeValueSizeInBytes)); >>>>>>> if (lockFileUsed != null) source.setLockFileUsed(Boolean.valueOf(lockFileUsed)); if (largeValuePath != null) source.setLargeValuePath(largeValuePath); if (largeValueSizeInBytes != null) source.setLargeValueSizeInBytes(Long.valueOf(largeValueSizeInBytes));
<<<<<<< import org.modeshape.common.text.FilenameEncoder; import org.modeshape.common.util.FileUtil; import com.google.common.collect.HashMultimap; import com.google.common.collect.Multimap; ======= import org.modeshape.common.collection.HashMultimap; import org.modeshape.common.collection.Multimap; >>>>>>> import org.modeshape.common.text.FilenameEncoder; import org.modeshape.common.util.FileUtil; import org.modeshape.common.collection.HashMultimap; import org.modeshape.common.collection.Multimap;
<<<<<<< import net.consensys.eventeum.service.SubscriptionService; ======= import org.springframework.context.event.ContextRefreshedEvent; import org.springframework.context.event.EventListener; >>>>>>> import net.consensys.eventeum.service.SubscriptionService; <<<<<<< private SubscriptionService subscriptionService; ======= private boolean initiallySubscribed = false; >>>>>>> private SubscriptionService subscriptionService; private boolean initiallySubscribed = false;
<<<<<<< List<BlockListener> blockListeners) { ======= AsyncTaskService asyncTaskService, List<BlockListener> blockListeners, List<ContractEventListener> contractEventListeners, @Qualifier("eternalRetryTemplate") RetryTemplate retryTemplate) { this.contractEventListeners = contractEventListeners; >>>>>>> AsyncTaskService asyncTaskService, List<BlockListener> blockListeners, List<ContractEventListener> contractEventListeners, @Qualifier("eternalRetryTemplate") RetryTemplate retryTemplate) { this.contractEventListeners = contractEventListeners; <<<<<<< filterSubscriptions = new HashMap<>(); ======= this.retryTemplate = retryTemplate; >>>>>>> this.retryTemplate = retryTemplate; filterSubscriptions = new HashMap<>(); <<<<<<< public ContractEventFilter registerContractEventFilter(ContractEventFilter filter, boolean broadcast) { populateIdIfMissing(filter); if (!isFilterRegistered(filter)) { filterSubscriptions.put(filter.getId(), filter); //TODO start block replay saveContractEventFilter(filter); if (broadcast) { broadcastContractEventFilterAdded(filter); } return filter; } else { log.info("Already registered contract event filter with id: " + filter.getId()); return getRegisteredFilter(filter.getId()); } ======= @Async public ContractEventFilter registerContractEventFilterWithRetries(ContractEventFilter filter, boolean broadcast) { return retryTemplate.execute((context) -> doRegisterContractEventFilter(filter, broadcast)); >>>>>>> @Async public ContractEventFilter registerContractEventFilterWithRetries(ContractEventFilter filter, boolean broadcast) { return retryTemplate.execute((context) -> doRegisterContractEventFilter(filter, broadcast)); <<<<<<< ======= public void resubscribeToAllSubscriptions(String nodeName) { final List<ContractEventFilter> currentFilters = filterSubscriptions .values() .stream() .map(filterSubscription -> filterSubscription.getFilter()) .filter(filter -> filter.getNode().equals(nodeName)) .collect(Collectors.toList()); final Map<String, FilterSubscription> newFilterSubscriptions = new ConcurrentHashMap<>(); currentFilters.forEach(filter -> registerContractEventFilter(filter, newFilterSubscriptions)); filterSubscriptions = newFilterSubscriptions; log.info("Resubscribed to event filters: {}", JSON.stringify(filterSubscriptions)); } /** * {@inheritDoc} */ @Override >>>>>>> <<<<<<< filterSubscriptions .entrySet() .removeIf(entry -> entry.getValue().getNode().equals(nodeName)); ======= filterSubscriptions.values().forEach(filterSub -> { if (filterSub.getFilter().getNode().equals(nodeName)) { unsubscribeFilterSubscription(filterSub); } }); } @Override public boolean isFullySubscribed(String nodeName) { return !filterSubscriptions .values() .stream() .filter(filterSubscription -> filterSubscription.getFilter().getNode().equals(nodeName)) .filter(filterSubscription -> filterSubscription.getSubscription().isDisposed()) .findFirst() .isPresent(); } @PreDestroy private void unregisterAllContractEventFilters() { filterSubscriptions.values().forEach(filterSub -> { unsubscribeFilterSubscription(filterSub); }); } public void unsubscribeFilterSubscription(FilterSubscription filterSubscription) { try { filterSubscription.getSubscription().dispose(); } catch (Throwable t) { log.info("Unable to unregister filter...this is probably because the " + "node has restarted or we're in websocket mode"); } >>>>>>> filterSubscriptions .entrySet() .removeIf(entry -> entry.getValue().getNode().equals(nodeName)); <<<<<<< ======= private FilterSubscription registerContractEventFilter(ContractEventFilter filter, Map<String, FilterSubscription> allFilterSubscriptions) { log.info("Registering filter: " + JSON.stringify(filter)); final NodeServices nodeServices = chainServices.getNodeServices(filter.getNode()); if (nodeServices == null) { log.warn("No node configure" + "d with name {}, not registering filter", filter.getNode()); return null; } final BlockchainService blockchainService = nodeServices.getBlockchainService(); final FilterSubscription sub = blockchainService.registerEventListener(filter, contractEvent -> { contractEventListeners.forEach( listener -> triggerListener(listener, contractEvent)); }); allFilterSubscriptions.put(filter.getId(), sub); log.debug("Registered filters: {}", JSON.stringify(allFilterSubscriptions)); return sub; } >>>>>>>
<<<<<<< mockRepo, mockFilterBroadcaster, Arrays.asList(mockBlockListener1, mockBlockListener2)); ======= mockRepo, mockFilterBroadcaster, new DummyAsyncTaskService(), Arrays.asList(mockBlockListener1, mockBlockListener2), Arrays.asList(mockEventListener1, mockEventListener2),mockRetryTemplate); >>>>>>> mockRepo, mockFilterBroadcaster, new DummyAsyncTaskService(), Arrays.asList(mockBlockListener1, mockBlockListener2), Arrays.asList(mockEventListener1, mockEventListener2), mockRetryTemplate); <<<<<<< final ContractEventFilter filter1 = createEventFilter(null); ======= final ContractEventFilter filter1 = createEventFilter(null, Constants.DEFAULT_NODE_NAME); when(mockBlockchainService.registerEventListener(any(ContractEventFilter.class), any(ContractEventListener.class))) .thenReturn(new FilterSubscription(filter1, mock(Disposable.class))); >>>>>>> final ContractEventFilter filter1 = createEventFilter(null, Constants.DEFAULT_NODE_NAME); <<<<<<< public void testUnregisterContractEventFilter() throws NotFoundException { ======= public void testResubscribeToAllSubscriptions() { final ContractEventFilter filter1 = createEventFilter(FILTER_ID, Constants.DEFAULT_NODE_NAME); final ContractEventFilter filter2 = createEventFilter("AnotherId", Constants.DEFAULT_NODE_NAME); final Disposable sub1 = mock(Disposable.class); final Disposable sub2 = mock(Disposable.class); when(mockBlockchainService.registerEventListener( eq(filter1), any(ContractEventListener.class))).thenReturn(new FilterSubscription(filter1, sub1)); when(mockBlockchainService.registerEventListener( eq(filter2), any(ContractEventListener.class))).thenReturn(new FilterSubscription(filter2, sub2)); //Add 2 filters underTest.registerContractEventFilter(filter1, true); underTest.registerContractEventFilter(filter2, true); reset(mockBlockchainService, mockRepo, mockFilterBroadcaster); when(mockBlockchainService.registerEventListener( eq(filter1), any(ContractEventListener.class))).thenReturn(new FilterSubscription(filter1, sub1)); when(mockBlockchainService.registerEventListener( eq(filter2), any(ContractEventListener.class))).thenReturn(new FilterSubscription(filter2, sub2)); underTest.resubscribeToAllSubscriptions(Constants.DEFAULT_NODE_NAME); verifyContractEventFilterRegistration(filter1, false, false); verifyContractEventFilterRegistration(filter2, false, false); } @Test public void testUnnregisterContractEventFilter() throws NotFoundException { >>>>>>> public void testUnregisterContractEventFilter() throws NotFoundException { <<<<<<< final ContractEventFilter filter1 = createEventFilter("filter1"); ======= final ContractEventFilter filter1 = createEventFilter("filter1", Constants.DEFAULT_NODE_NAME); final Disposable sub1 = mock(Disposable.class); >>>>>>> final ContractEventFilter filter1 = createEventFilter("filter1", Constants.DEFAULT_NODE_NAME);
<<<<<<< import javax.swing.InputMap; import javax.swing.JOptionPane; import javax.swing.KeyStroke; import javax.swing.SwingUtilities; import javax.swing.ToolTipManager; import javax.swing.UIManager; import javax.swing.text.DefaultEditorKit; ======= >>>>>>> import javax.swing.InputMap; import javax.swing.JOptionPane; import javax.swing.KeyStroke; import javax.swing.SwingUtilities; import javax.swing.ToolTipManager; import javax.swing.UIManager; import javax.swing.text.DefaultEditorKit; <<<<<<< "not have installed this " + "in the right location.<br/><br/>The exe or jar file" + "should " + "be placed in it's own folder with nothing else " + "in it<br/><br/>Are you 100% sure that's " + "what you've" + "done?</p></html>", "Warning", JOptionPane.DEFAULT_OPTION, ======= "not have installed this " + "in the right location.<br/><br/>The exe or jar file" + "should " + "be placed in it's own folder with nothing else " + "in it<br/><br/>Are you 100% sure" + " that's " + "what you've" + "done?</p></html>", "Warning", JOptionPane.DEFAULT_OPTION, >>>>>>> "not have installed this " + "in the right location.<br/><br/>The exe or jar file" + "should " + "be placed in it's own folder with nothing else " + "in it<br/><br/>Are you 100% sure that's " + "not have installed this " + "in the right location.<br/><br/>The exe or jar file" + "should " + "be placed in it's own folder with nothing else " + "in it<br/><br/>Are you 100% sure" + " that's " + "what you've" + "done?</p></html>", "Warning", JOptionPane.DEFAULT_OPTION,
<<<<<<< import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.Future; import java.util.concurrent.ThreadFactory; ======= import java.util.Map; import java.util.concurrent.*; >>>>>>> import java.util.concurrent.ExecutionException; <<<<<<< private synchronized void resetRenderResults() { renderResults = ImmutableMap.of(); } private synchronized void render() { // If we're already rendering, return. if (isRendering.get()) return; // Before starting the renderNetwork, turn the "should render" flag off and the "is rendering" flag on. synchronized (shouldRender) { synchronized (isRendering) { shouldRender.set(false); isRendering.set(true); } } final NodeLibrary renderLibrary = getNodeLibrary(); final Node renderNetwork = getRenderedNode(); checkState(currentRender == null, "Another render is still in progress."); currentRender = renderService.submit(new Runnable() { public void run() { ImmutableMap<String,?> data = ImmutableMap.of( "mouse.position",viewerPane.getViewer().getLastMousePosition(), "osc.messages", oscMessages, "osc.cache", new HashSet<String>()); final NodeContext context = new NodeContext(renderLibrary, getFunctionRepository(), frame, data, renderResults); Throwable renderException = null; startRendering(context); List<?> results = null; try { results = context.renderNode(renderNetwork); context.renderAlwaysRenderedNodes(renderNetwork); renderResults = context.getRenderResults(); } catch (NodeRenderException e) { LOG.log(Level.WARNING, "Error while processing", e); renderException = e; } catch (Exception e) { LOG.log(Level.WARNING, "Other error while processing", e); renderException = e; } // We finished rendering so set the renderNetwork flag off. isRendering.set(false); Set<String> oscCache = (Set<String>) context.getData().get("osc.cache"); Map<String,List<Object>> oscCachedMessages = new HashMap<String,List<Object>>(); for (String key : oscCache) { if (oscMessages.containsKey(key)) oscCachedMessages.put(key, oscMessages.get(key)); } oscMessages = oscCachedMessages; if (renderException == null) { finishedRendering(renderNetwork, results); // If, in the meantime, we got a new renderNetwork request, call the renderNetwork method again. if (shouldRender.get()) { SwingUtilities.invokeLater(new Runnable() { public void run() { render(); } }); } } else { finishedRenderingWithError(context, renderNetwork, renderException); } } }); } ======= >>>>>>> private synchronized void resetRenderResults() { renderResults = ImmutableMap.of(); }
<<<<<<< import java.util.Collection; import java.util.HashMap; ======= >>>>>>> import java.util.HashMap; <<<<<<< public enum Attribute {PROTOTYPE, NAME, DESCRIPTION, IMAGE, FUNCTION, POSITION, INPUTS, PUBLISHED_INPUTS, OUTPUT_TYPE, OUTPUT_RANGE, CHILDREN, RENDERED_CHILD_NAME, CONNECTIONS, HANDLE} ======= /** * Check if data from the output node can be converted and used in the input port. * <p/> * The relation is not commutative: * an output port that can be converted to an input port does not imply the reverse. * * @param outputNode The output node * @param inputPort The input port * @return true if the input port is compatible */ public static boolean isCompatible(Node outputNode, Port inputPort) { checkNotNull(outputNode); checkNotNull(inputPort); return isCompatible(outputNode.getOutputType(), inputPort.getType()); } /** * Check if data from the output can be converted and used in the input. * <p/> * The relation is not commutative: * an output port that can be converted to an input port does not imply the reverse. * * @param outputType The type of the output port of the upstream node * @param inputType The type of the input port of the downstream node * @return true if the types are compatible */ public static boolean isCompatible(String outputType, String inputType) { checkNotNull(outputType); checkNotNull(inputType); // If the output and input type are the same, they are compatible. if (outputType.equals(inputType)) return true; // Everything can be converted to a string. if (inputType.equals(Port.TYPE_STRING)) return true; // Integers can be converted to floating-point numbers without loss of information. if (outputType.equals(Port.TYPE_INT) && inputType.equals(Port.TYPE_FLOAT)) return true; // Floating-point numbers can be converted to integers: they are rounded. if (outputType.equals(Port.TYPE_FLOAT) && inputType.equals(Port.TYPE_INT)) return true; // A number can be converted to a point: both X and Y then get the same value. if (outputType.equals(Port.TYPE_INT) && inputType.equals(Port.TYPE_POINT)) return true; if (outputType.equals(Port.TYPE_FLOAT) && inputType.equals(Port.TYPE_POINT)) return true; // If none of these tests pass, the types are not compatible. return false; } public enum Attribute {PROTOTYPE, NAME, DESCRIPTION, IMAGE, FUNCTION, POSITION, INPUTS, OUTPUT_TYPE, OUTPUT_RANGE, CHILDREN, RENDERED_CHILD_NAME, CONNECTIONS, HANDLE} >>>>>>> public enum Attribute {PROTOTYPE, NAME, DESCRIPTION, IMAGE, FUNCTION, POSITION, INPUTS, PUBLISHED_INPUTS, OUTPUT_TYPE, OUTPUT_RANGE, CHILDREN, RENDERED_CHILD_NAME, CONNECTIONS, HANDLE} /** * Check if data from the output node can be converted and used in the input port. * <p/> * The relation is not commutative: * an output port that can be converted to an input port does not imply the reverse. * * @param outputNode The output node * @param inputPort The input port * @return true if the input port is compatible */ public static boolean isCompatible(Node outputNode, Port inputPort) { checkNotNull(outputNode); checkNotNull(inputPort); return isCompatible(outputNode.getOutputType(), inputPort.getType()); } /** * Check if data from the output can be converted and used in the input. * <p/> * The relation is not commutative: * an output port that can be converted to an input port does not imply the reverse. * * @param outputType The type of the output port of the upstream node * @param inputType The type of the input port of the downstream node * @return true if the types are compatible */ public static boolean isCompatible(String outputType, String inputType) { checkNotNull(outputType); checkNotNull(inputType); // If the output and input type are the same, they are compatible. if (outputType.equals(inputType)) return true; // Everything can be converted to a string. if (inputType.equals(Port.TYPE_STRING)) return true; // Integers can be converted to floating-point numbers without loss of information. if (outputType.equals(Port.TYPE_INT) && inputType.equals(Port.TYPE_FLOAT)) return true; // Floating-point numbers can be converted to integers: they are rounded. if (outputType.equals(Port.TYPE_FLOAT) && inputType.equals(Port.TYPE_INT)) return true; // A number can be converted to a point: both X and Y then get the same value. if (outputType.equals(Port.TYPE_INT) && inputType.equals(Port.TYPE_POINT)) return true; if (outputType.equals(Port.TYPE_FLOAT) && inputType.equals(Port.TYPE_POINT)) return true; // If none of these tests pass, the types are not compatible. return false; }
<<<<<<< * This is used as the key for the inputValuesMap. */ public static final class NodePort { private final String node; private final String port; public static NodePort of(String node, String port) { return new NodePort(node, port); } private NodePort(String node, String port) { checkNotNull(node); checkNotNull(port); this.node = node; this.port = port; } @Override public boolean equals(Object o) { if (!(o instanceof NodePort)) return false; final NodePort other = (NodePort) o; return Objects.equal(node, other.node) && Objects.equal(port, other.port); } @Override public int hashCode() { return Objects.hashCode(node, port); } } /** ======= >>>>>>> * This is used as the key for the inputValuesMap. */ public static final class NodePort { private final String node; private final String port; public static NodePort of(String node, String port) { return new NodePort(node, port); } private NodePort(String node, String port) { checkNotNull(node); checkNotNull(port); this.node = node; this.port = port; } @Override public boolean equals(Object o) { if (!(o instanceof NodePort)) return false; final NodePort other = (NodePort) o; return Objects.equal(node, other.node) && Objects.equal(port, other.port); } @Override public int hashCode() { return Objects.hashCode(node, port); } } /**
<<<<<<< import org.foxbpm.engine.impl.db.PersistentObject; ======= import org.apache.ibatis.session.SqlSessionFactory; import org.foxbpm.engine.ProcessEngineManagement; import org.foxbpm.engine.db.PersistentObject; import org.foxbpm.engine.exception.FixFlowException; >>>>>>> import org.foxbpm.engine.db.PersistentObject;
<<<<<<< ======= import org.foxbpm.engine.Constant; import org.foxbpm.engine.exception.FoxBPMBizException; import org.foxbpm.engine.exception.FoxBPMIllegalArgumentException; import org.foxbpm.engine.exception.FoxBPMObjectNotFoundException; >>>>>>> import org.foxbpm.engine.Constant; <<<<<<< import org.foxbpm.engine.impl.util.ExceptionUtil; ======= import org.foxbpm.engine.impl.util.DataVarUtil; >>>>>>> import org.foxbpm.engine.impl.util.ExceptionUtil; import org.foxbpm.engine.impl.util.DataVarUtil;
<<<<<<< String getProcessDefinitionName(); ======= /** * 获取流程主题 * @return */ String getSubject(); /** * 获取流程定义key * @return */ String getProcessDefinitionKey(); /** * 获取流程启动人 * 正常人工启动时此属性和initator一致 * 定时启动任务,此属性可能不一致 * @return */ String getStartAuthor(); /** * 获取流程的提交人 * @return */ String getInitiator(); /** * 获取流程开始时间 * @return */ Date getStartTime(); /** * 获取流程结束时间 * @return */ Date getEndTime(); /** * 获取流程上次更新时间 * @return */ Date getUpdateTime(); /** * 获取流程状态 * 详见ProcessInstanceStatus * running,suspend,termination,complete * @return */ String getInstanceStatus(); /** * 获取流程实例当前所在位置,如果多个节点,则以逗号分隔 * @return */ String getProcessLocation(); /** * 判断流程是否暂停 * @return */ boolean isSuspended(); /** * 获取流程关联键 * @return */ String getBizKey(); /** * 获取实体属性map * @return */ Map<String, Object> getPersistentState(); >>>>>>> String getProcessDefinitionName(); /** * 获取流程主题 * @return */ String getSubject(); /** * 获取流程定义key * @return */ String getProcessDefinitionKey(); /** * 获取流程启动人 * 正常人工启动时此属性和initator一致 * 定时启动任务,此属性可能不一致 * @return */ String getStartAuthor(); /** * 获取流程的提交人 * @return */ String getInitiator(); /** * 获取流程开始时间 * @return */ Date getStartTime(); /** * 获取流程结束时间 * @return */ Date getEndTime(); /** * 获取流程上次更新时间 * @return */ Date getUpdateTime(); /** * 获取流程状态 * 详见ProcessInstanceStatus * running,suspend,termination,complete * @return */ String getInstanceStatus(); /** * 获取流程实例当前所在位置,如果多个节点,则以逗号分隔 * @return */ String getProcessLocation(); /** * 判断流程是否暂停 * @return */ boolean isSuspended(); /** * 获取流程关联键 * @return */ String getBizKey(); /** * 获取实体属性map * @return */ Map<String, Object> getPersistentState();
<<<<<<< import org.apache.http.*; import org.apache.http.client.HttpRequestRetryHandler; import org.apache.http.client.config.RequestConfig; import org.apache.http.config.ConnectionConfig; import org.apache.http.config.RegistryBuilder; import org.apache.http.conn.socket.ConnectionSocketFactory; import org.apache.http.conn.socket.PlainConnectionSocketFactory; import org.apache.http.conn.ssl.NoopHostnameVerifier; import org.apache.http.conn.ssl.SSLConnectionSocketFactory; import org.apache.http.impl.DefaultConnectionReuseStrategy; import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.DefaultHttpRequestRetryHandler; import org.apache.http.impl.client.HttpClientBuilder; import org.apache.http.impl.conn.PoolingHttpClientConnectionManager; import org.apache.http.message.BasicHeader; import org.apache.http.protocol.HttpContext; import ru.yandex.clickhouse.settings.ClickHouseProperties; import ru.yandex.clickhouse.util.ssl.NonValidatingTrustManager; import javax.net.ssl.HostnameVerifier; import javax.net.ssl.KeyManager; import javax.net.ssl.SSLContext; import javax.net.ssl.TrustManager; import javax.net.ssl.TrustManagerFactory; ======= >>>>>>> <<<<<<< .disableContentCompression() // gzip is not needed. Use lz4 when compress=1 ======= .setDefaultCredentialsProvider(getDefaultCredentialsProvider()) .disableContentCompression() // gzip здесь ни к чему. Используется lz4 при compress=1 >>>>>>> .setDefaultCredentialsProvider(getDefaultCredentialsProvider()) .disableContentCompression() // gzip is not needed. Use lz4 when compress=1 <<<<<<< private HttpRequestRetryHandler getRequestRetryHandler() { final int maxRetries = properties.getMaxRetries(); return new DefaultHttpRequestRetryHandler(maxRetries, false) { @Override public boolean retryRequest(IOException exception, int executionCount, HttpContext context) { if (executionCount > maxRetries || context == null || !Boolean.TRUE.equals(context.getAttribute("is_idempotent"))) { return false; } return (exception instanceof NoHttpResponseException) || super.retryRequest(exception, executionCount, context); } }; } ======= public static HttpClientContext createClientContext(ClickHouseProperties props) { if (props == null || !isConfigurationValidForAuth(props)) { return HttpClientContext.create(); } AuthCache authCache = new BasicAuthCache(); BasicScheme basicAuth = new BasicScheme(); authCache.put(getTargetHost(props), basicAuth); HttpClientContext ctx = HttpClientContext.create(); ctx.setAuthCache(authCache); return ctx; } >>>>>>> private HttpRequestRetryHandler getRequestRetryHandler() { final int maxRetries = properties.getMaxRetries(); return new DefaultHttpRequestRetryHandler(maxRetries, false) { @Override public boolean retryRequest(IOException exception, int executionCount, HttpContext context) { if (executionCount > maxRetries || context == null || !Boolean.TRUE.equals(context.getAttribute("is_idempotent"))) { return false; } return (exception instanceof NoHttpResponseException) || super.retryRequest(exception, executionCount, context); } }; } public static HttpClientContext createClientContext(ClickHouseProperties props) { if (props == null || !isConfigurationValidForAuth(props)) { return HttpClientContext.create(); } AuthCache authCache = new BasicAuthCache(); BasicScheme basicAuth = new BasicScheme(); authCache.put(getTargetHost(props), basicAuth); HttpClientContext ctx = HttpClientContext.create(); ctx.setAuthCache(authCache); return ctx; } <<<<<<< private SSLContext getSSLContext() ======= private ConnectionKeepAliveStrategy createKeepAliveStrategy() { return new ConnectionKeepAliveStrategy() { @Override public long getKeepAliveDuration(HttpResponse httpResponse, HttpContext httpContext) { // in case of errors keep-alive not always works. close connection just in case if (httpResponse.getStatusLine().getStatusCode() != HttpURLConnection.HTTP_OK) { return -1; } HeaderElementIterator it = new BasicHeaderElementIterator( httpResponse.headerIterator(HTTP.CONN_DIRECTIVE)); while (it.hasNext()) { HeaderElement he = it.nextElement(); String param = he.getName(); //String value = he.getValue(); if (param != null && param.equalsIgnoreCase(HTTP.CONN_KEEP_ALIVE)) { return properties.getKeepAliveTimeout(); } } return -1; } }; } private SSLContext getSSLContext() >>>>>>> private SSLContext getSSLContext()
<<<<<<< this.usePathAsDb = (Boolean) getSetting(info, ClickHouseConnectionSettings.USE_PATH_AS_DB); this.path = (String) getSetting(info, ClickHouseConnectionSettings.PATH); ======= this.maxRedirects = (Integer) getSetting(info, ClickHouseConnectionSettings.MAX_REDIRECTS); this.checkForRedirects = (Boolean) getSetting(info, ClickHouseConnectionSettings.CHECK_FOR_REDIRECTS); >>>>>>> this.usePathAsDb = (Boolean) getSetting(info, ClickHouseConnectionSettings.USE_PATH_AS_DB); this.path = (String) getSetting(info, ClickHouseConnectionSettings.PATH); this.maxRedirects = (Integer) getSetting(info, ClickHouseConnectionSettings.MAX_REDIRECTS); this.checkForRedirects = (Boolean) getSetting(info, ClickHouseConnectionSettings.CHECK_FOR_REDIRECTS); <<<<<<< ret.put(ClickHouseConnectionSettings.USE_PATH_AS_DB.getKey(), String.valueOf(usePathAsDb)); ret.put(ClickHouseConnectionSettings.PATH.getKey(), String.valueOf(path)); ======= ret.put(ClickHouseConnectionSettings.MAX_REDIRECTS.getKey(), String.valueOf(maxRedirects)); ret.put(ClickHouseConnectionSettings.CHECK_FOR_REDIRECTS.getKey(), String.valueOf(checkForRedirects)); >>>>>>> ret.put(ClickHouseConnectionSettings.USE_PATH_AS_DB.getKey(), String.valueOf(usePathAsDb)); ret.put(ClickHouseConnectionSettings.PATH.getKey(), String.valueOf(path)); ret.put(ClickHouseConnectionSettings.MAX_REDIRECTS.getKey(), String.valueOf(maxRedirects)); ret.put(ClickHouseConnectionSettings.CHECK_FOR_REDIRECTS.getKey(), String.valueOf(checkForRedirects)); <<<<<<< setUsePathAsDb(properties.usePathAsDb); setPath(properties.path); ======= setMaxRedirects(properties.maxRedirects); setCheckForRedirects(properties.checkForRedirects); >>>>>>> setUsePathAsDb(properties.usePathAsDb); setPath(properties.path); setMaxRedirects(properties.maxRedirects); setCheckForRedirects(properties.checkForRedirects);
<<<<<<< Integer maxPartitionsPerInsertBlock = 200; ======= Long maxInsertBlockSize = 142L; Boolean insertDeduplicate = true; Boolean insertDistributedSync = true; >>>>>>> Integer maxPartitionsPerInsertBlock = 200; Long maxInsertBlockSize = 142L; Boolean insertDeduplicate = true; Boolean insertDistributedSync = true;
<<<<<<< expandAllAction.setImageDescriptor(FmOutlinePageContextMenu.IMG_EXPAND); // icon for expand added abstractAction = new AbstractAction(this, featureModel, (ObjectUndoContext) featureModel.getUndoContext()); ======= expandAllAction.setImageDescriptor(FmOutlinePageContextMenu.IMG_EXPAND); // icon for expand added abstractAction = new AbstractAction(this, featureModel); >>>>>>> expandAllAction.setImageDescriptor(FmOutlinePageContextMenu.IMG_EXPAND); // icon for expand added abstractAction = new AbstractAction(this, featureModel); <<<<<<< } boolean isEmpty = true; for (final Object obj : ((StructuredSelection) getSelection()).toArray()) { if ((obj instanceof FeatureEditPart) || (obj instanceof IFeature)) { isEmpty = false; } } if (!isEmpty) { menu.add(new Separator()); menu.add(colorSelectedFeatureAction); } menu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS)); if (featureModelEditor.getFeatureModel().getStructure().hasHidden()) { ======= >>>>>>> <<<<<<< menu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS)); menu.add(exportFeatureModelAction); ======= >>>>>>>
<<<<<<< setId(ID); if (!featureModel.isLegendHidden()) { setText(HIDE_LEGEND); } else { setText(SHOW_LEGEND); } ======= setText(SHOW_LEGEND); setChecked(!featureModel.isLegendHidden()); >>>>>>> setId(ID); setText(SHOW_LEGEND); setChecked(!featureModel.isLegendHidden());
<<<<<<< import de.ovgu.featureide.fm.core.io.manager.FeatureModelManager; import de.ovgu.featureide.fm.core.io.manager.SimpleFileHandler; import de.ovgu.featureide.fm.core.io.xml.XmlFeatureModelFormat; ======= import de.ovgu.featureide.fm.core.io.manager.FileHandler; >>>>>>> import de.ovgu.featureide.fm.core.io.manager.SimpleFileHandler; <<<<<<< final IPath fullFilePath = new Path(page.fileName.getText()); if ((project == null) || !createRelativeFile(fullFilePath, project)) { boolean foundParent = false; for (final IProject otherProject : ResourcesPlugin.getWorkspace().getRoot().getProjects()) { if (createRelativeFile(fullFilePath, otherProject)) { foundParent = true; break; } } if (!foundParent) { final XmlFeatureModelFormat format = new XmlFeatureModelFormat(); IFeatureModel featureModel; final String filePathString = fullFilePath.toOSString(); try { featureModel = FMFactoryManager.getFactory(filePathString, format).createFeatureModel(); } catch (final NoSuchExtensionException e) { Logger.logError(e); featureModel = FMFactoryManager.getEmptyFeatureModel(); } featureModel.createDefaultValues(""); SimpleFileHandler.save(Paths.get(filePathString), featureModel, format); } ======= final IFeatureModelFormat format = formatPage.getFormat(); final Path fmPath = getNewFilePath(format); IFeatureModel featureModel; try { featureModel = FMFactoryManager.getFactory(fmPath.toString(), format).createFeatureModel(); } catch (NoSuchExtensionException e) { Logger.logError(e); featureModel = FMFactoryManager.getEmptyFeatureModel(); >>>>>>> final IFeatureModelFormat format = formatPage.getFormat(); final Path fmPath = getNewFilePath(format); IFeatureModel featureModel; try { featureModel = FMFactoryManager.getFactory(fmPath.toString(), format).createFeatureModel(); } catch (final NoSuchExtensionException e) { Logger.logError(e); featureModel = FMFactoryManager.getEmptyFeatureModel();
<<<<<<< import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.io.ObjectInputStream; ======= import java.nio.file.Paths; >>>>>>> import java.nio.file.Path; import java.nio.file.Paths; <<<<<<< import de.ovgu.featureide.fm.core.FeatureModel; import de.ovgu.featureide.fm.core.PropertyConstants; import de.ovgu.featureide.fm.core.conf.ConfigurationFG; import de.ovgu.featureide.fm.core.conf.IFeatureGraph; ======= import de.ovgu.featureide.fm.core.ModelMarkerHandler; 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.base.event.PropertyConstants; >>>>>>> import de.ovgu.featureide.fm.core.ModelMarkerHandler; 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.base.event.PropertyConstants; 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.configuration.ConfigurationReader; import de.ovgu.featureide.fm.core.configuration.ConfigurationWriter; import de.ovgu.featureide.fm.core.configuration.FeatureIDEFormat; import de.ovgu.featureide.fm.core.configuration.IConfiguration; import de.ovgu.featureide.fm.core.io.AbstractFeatureModelReader; import de.ovgu.featureide.fm.core.io.ModelIOFactory; import de.ovgu.featureide.fm.core.io.UnsupportedModelException; ======= import de.ovgu.featureide.fm.core.configuration.ConfigurationMatrix; import de.ovgu.featureide.fm.core.configuration.ConfigurationPropagatorJobWrapper.IConfigJob; import de.ovgu.featureide.fm.core.io.Problem; import de.ovgu.featureide.fm.core.io.manager.ConfigurationManager; import de.ovgu.featureide.fm.core.io.manager.FeatureModelManager; import de.ovgu.featureide.fm.core.io.manager.FileManagerMap; >>>>>>> import de.ovgu.featureide.fm.core.configuration.ConfigurationMatrix; import de.ovgu.featureide.fm.core.io.FeatureGraphFormat; import de.ovgu.featureide.fm.core.io.Problem; import de.ovgu.featureide.fm.core.io.manager.ConfigurationManager; import de.ovgu.featureide.fm.core.io.manager.FeatureModelManager; import de.ovgu.featureide.fm.core.io.manager.FileManagerMap; import de.ovgu.featureide.fm.core.io.manager.FileReader; <<<<<<< private IFile internalFile; public FeatureModel featureModel = new FeatureModel(); private IConfiguration configuration = null; ======= ModelMarkerHandler<IFile> markerHandler; public FeatureModelManager featureModelManager; public ConfigurationManager configurationManager; >>>>>>> ModelMarkerHandler<IFile> markerHandler; public ConfigurationManager configurationManager; public FeatureModelManager featureModelManager; <<<<<<< final IFeatureGraph fg = loadFeatureGraph(res); if (fg == null) { configuration = new Configuration(featureModel, Configuration.PARAM_IGNOREABSTRACT | Configuration.PARAM_LAZY); } else { featureModel.setFeatureGraph(fg); configuration = new ConfigurationFG(featureModel, ConfigurationFG.PARAM_IGNOREABSTRACT | ConfigurationFG.PARAM_LAZY); } try { ConfigurationReader reader = new ConfigurationReader(configuration); if (!internalFile.exists() || !reader.readFromFile(internalFile)) { reader.readFromFile(file); } } catch (Exception e) { FMCorePlugin.getDefault().logError(e); ======= //TODO mapping model // if (mappingModel) { // featureModelManager = FeatureModelManager.getInstance(absolutePath, format); // featureModel = ((ExtendedFeatureModel) featureModel).getMappingModel(); // } final Configuration c = new Configuration(featureModelManager.getObject(), Configuration.PARAM_LAZY | Configuration.PARAM_IGNOREABSTRACT | Configuration.PARAM_PROPAGATE); configurationManager = FileManagerMap.<Configuration, ConfigurationManager>getInstance(file.getLocation().toOSString()); if (configurationManager != null) { configurationManager.setConfiguration(c); configurationManager.read(); } else { configurationManager = ConfigurationManager.getInstance(c, file.getLocation().toOSString()); >>>>>>> //TODO mapping model // if (mappingModel) { // featureModelManager = FeatureModelManager.getInstance(absolutePath, format); // featureModel = ((ExtendedFeatureModel) featureModel).getMappingModel(); // <<<<<<< private void setConfiguration() { readFeatureModel(); if (configuration instanceof Configuration) { configuration = new Configuration((Configuration) configuration, featureModel); } // configuration.getPropagator().update(false, null, new WorkMonitor()); configuration.update(false, null); if (!isDirty()) { doSave(null); } } /** * Reads the featureModel from the modelFile. */ private void readFeatureModel() { final int fileType = ModelIOFactory.getTypeByFileName(modelFile.getName()); featureModel = ModelIOFactory.getNewFeatureModel(fileType); featureModel.initFMComposerExtension(file.getProject()); final AbstractFeatureModelReader reader = ModelIOFactory.getModelReader(featureModel, fileType); try { reader.readFromFile(modelFile); } catch (FileNotFoundException | UnsupportedModelException e) { FMUIPlugin.getDefault().logError(e); } } ======= >>>>>>> <<<<<<< public IConfiguration getConfiguration() { return configuration; ======= public Configuration getConfiguration() { return configurationManager.editObject(); >>>>>>> public Configuration getConfiguration() { return configurationManager.editObject();
<<<<<<< public Explanation<?> getActiveExplanation() { return activeExplanation; ======= public Explanation getActiveExplanation() { return this.activeExplanation; >>>>>>> public Explanation<?> getActiveExplanation() { return this.activeExplanation; <<<<<<< // Deactivate the old active explanation. final FeatureModelExplanation<?> oldActiveExplanation = (FeatureModelExplanation<?>) event.getOldValue(); ======= //Deactivate the old active explanation. final FeatureModelExplanation oldActiveExplanation = (FeatureModelExplanation) event.getOldValue(); >>>>>>> //Deactivate the old active explanation. final FeatureModelExplanation<?> oldActiveExplanation = (FeatureModelExplanation<?>) event.getOldValue(); <<<<<<< // Activate the new active explanation. final FeatureModelExplanation<?> newActiveExplanation = (FeatureModelExplanation<?>) event.getNewValue(); ======= //Activate the new active explanation. final FeatureModelExplanation newActiveExplanation = (FeatureModelExplanation) event.getNewValue(); >>>>>>> //Activate the new active explanation. final FeatureModelExplanation<?> newActiveExplanation = (FeatureModelExplanation<?>) event.getNewValue(); <<<<<<< // Notify each element affected by the new active explanation of its new active reasons. for (final Reason<?> reason : newActiveExplanation.getReasons()) { for (final IFeatureModelElement sourceElement : ((FeatureModelReason) reason).getSubject().getElements()) { ======= //Notify each element affected by the new active explanation of its new active reasons. for (final Reason reason : newActiveExplanation.getReasons()) { for (final IFeatureModelElement sourceElement : ((FeatureModelReason) reason).getTrace().getElements()) { >>>>>>> //Notify each element affected by the new active explanation of its new active reasons. for (final Reason<?> reason : newActiveExplanation.getReasons()) { for (final IFeatureModelElement sourceElement : ((FeatureModelReason) reason).getSubject().getElements()) {
<<<<<<< import de.ovgu.featureide.fm.core.io.manager.ConfigurationManager; import de.ovgu.featureide.fm.core.io.manager.FeatureModelManager; import de.ovgu.featureide.fm.core.io.manager.FeatureModelManager.FeatureModelSnapshot; ======= >>>>>>> import de.ovgu.featureide.fm.core.io.manager.FeatureModelManager; import de.ovgu.featureide.fm.core.io.manager.FeatureModelManager.FeatureModelSnapshot; <<<<<<< final List<Configuration> confs = new LinkedList<>(); final FileHandler<Configuration> writer = new FileHandler<>(ConfigurationManager.getDefaultFormat()); final ConfigurationPropagator propagator; if (project != null) { propagator = ((FeatureModelSnapshot) project.getFeatureModelManager().getSnapshot()).getPropagator(false); } else { propagator = FeatureModelManager.getInstance(featureModel).getSnapshot().getPropagator(false); } final List<List<String>> solutions = LongRunningWrapper.runMethod(propagator.coverFeatures(unusedFeatures, false), monitor); for (final List<String> solution : solutions) { final Configuration configuration = new Configuration(featureModel); for (final String feature : solution) { configuration.setManual(feature, Selection.SELECTED); } if (collect) { confs.add(configuration); } else { final IFile configurationFile = getConfigurationFile(project.getConfigFolder()); writer.write(Paths.get(configurationFile.getLocationURI()), configuration); ======= final List<Configuration> confs = new LinkedList<Configuration>(); final FileHandler<Configuration> writer = new FileHandler<>(configFormat); Configuration configuration = new Configuration(featureModel, false); try { final List<List<String>> solutions = configuration.coverFeatures(unusedFeatures, monitor, false); for (final List<String> solution : solutions) { configuration = new Configuration(featureModel, false); for (final String feature : solution) { if (!"True".equals(feature)) { configuration.setManual(feature, Selection.SELECTED); } } if (collect) { confs.add(configuration); } else { final IFile configurationFile = getConfigurationFile(project.getConfigFolder()); writer.write(Paths.get(configurationFile.getLocationURI()), configuration); } >>>>>>> final List<Configuration> confs = new LinkedList<>(); final FileHandler<Configuration> writer = new FileHandler<>(configFormat); final ConfigurationPropagator propagator; if (project != null) { propagator = ((FeatureModelSnapshot) project.getFeatureModelManager().getSnapshot()).getPropagator(false); } else { propagator = FeatureModelManager.getInstance(featureModel).getSnapshot().getPropagator(false); } final List<List<String>> solutions = LongRunningWrapper.runMethod(propagator.coverFeatures(unusedFeatures, false), monitor); for (final List<String> solution : solutions) { final Configuration configuration = new Configuration(featureModel); for (final String feature : solution) { configuration.setManual(feature, Selection.SELECTED); } if (collect) { confs.add(configuration); } else { final IFile configurationFile = getConfigurationFile(project.getConfigFolder()); writer.write(Paths.get(configurationFile.getLocationURI()), configuration);
<<<<<<< ======= import de.ovgu.featureide.fm.core.IExtension; import de.ovgu.featureide.fm.core.configuration.SelectableFeature; >>>>>>> import de.ovgu.featureide.fm.core.configuration.SelectableFeature;
<<<<<<< /* * Copyright (C) 2012-2019 52°North Initiative for Geospatial Open Source ======= /** * Copyright (C) 2012-2020 52°North Initiative for Geospatial Open Source >>>>>>> /* * Copyright (C) 2012-2020 52°North Initiative for Geospatial Open Source
<<<<<<< import de.ovgu.featureide.fm.core.job.monitor.IMonitor; import de.ovgu.featureide.fm.core.job.monitor.NullMonitor; ======= 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.monitor.IMonitor; import de.ovgu.featureide.fm.core.job.monitor.NullMonitor; <<<<<<< public HashMap<Object, Object> analyzeFeatureModel(IMonitor monitor) { resetAttributeFlags(); this.monitor = monitor == null ? new NullMonitor() : monitor; if (calculateConstraints) { beginTask(fm.getConstraintCount() + 2); } else { beginTask(2); } HashMap<Object, Object> oldAttributes = new HashMap<Object, Object>(); HashMap<Object, Object> changedAttributes = new HashMap<Object, Object>(); // put root always in so it will be refreshed (void/non-void) changedAttributes.put(fm.getStructure().getRoot().getFeature(), FeatureStatus.NORMAL); if (calculateFeatures) { updateFeatures(oldAttributes, changedAttributes); } if (!canceled() && calculateConstraints) { updateConstraints(oldAttributes, changedAttributes); } // put root always in so it will be refreshed (void/non-void) return changedAttributes; ======= public HashMap<Object, Object> analyzeFeatureModel(IProgressMonitor monitor) { final WorkMonitor workMonitor = new WorkMonitor(); workMonitor.setMonitor(monitor); final FeatureModelAnalysis analysis = new FeatureModelAnalysis(fm); analysis.setCalculateFeatures(calculateFeatures); analysis.setCalculateConstraints(calculateConstraints); analysis.setCalculateRedundantConstraints(calculateRedundantConstraints); analysis.setCalculateTautologyConstraints(calculateTautologyConstraints); final HashMap<Object, Object> newAttributes = LongRunningWrapper.runMethod(analysis, workMonitor); cachedValidity = analysis.isValid(); cachedCoreFeatures = analysis.getCoreFeatures(); cachedDeadFeatures = analysis.getDeadFeatures(); cachedFalseOptionalFeatures = analysis.getFalseOptionalFeatures(); return newAttributes; >>>>>>> public HashMap<Object, Object> analyzeFeatureModel(IMonitor monitor) { this.monitor = monitor == null ? new NullMonitor() : monitor; final FeatureModelAnalysis analysis = new FeatureModelAnalysis(fm); analysis.setCalculateFeatures(calculateFeatures); analysis.setCalculateConstraints(calculateConstraints); analysis.setCalculateRedundantConstraints(calculateRedundantConstraints); analysis.setCalculateTautologyConstraints(calculateTautologyConstraints); final HashMap<Object, Object> newAttributes = LongRunningWrapper.runMethod(analysis, this.monitor); cachedValidity = analysis.isValid(); cachedCoreFeatures = analysis.getCoreFeatures(); cachedDeadFeatures = analysis.getDeadFeatures(); cachedFalseOptionalFeatures = analysis.getFalseOptionalFeatures(); return newAttributes; <<<<<<< private void findRedundantConstraints(IFeatureModel clone, 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) { 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; Logger.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) { Logger.logError(e); } try { if (cachedValidity) { setSubTask(GET_FALSE_OPTIONAL_FEATURES_); getFalseOptionalFeature(oldAttributes, changedAttributes); worked(1); } } catch (Exception e) { Logger.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();
<<<<<<< ======= /* * (non-Javadoc) * @see de.ovgu.featureide.fm.ui.editors.IGraphicalFeatureModel#getConstraintIndex(de.ovgu.featureide.fm.core.base.impl.Constraint) */ >>>>>>> <<<<<<< ======= /* * (non-Javadoc) * @see de.ovgu.featureide.fm.ui.editors.IGraphicalFeatureModel#setActiveExplanation(de.ovgu.featureide.fm.core.explanations.Explanation) */ >>>>>>>
<<<<<<< import java.beans.PropertyChangeEvent; import java.nio.file.Path; ======= import java.nio.file.Paths; >>>>>>> import java.nio.file.Path; <<<<<<< textEditor.resetTextEditor(); updateConfigurationEditors(); ======= >>>>>>>
<<<<<<< cAction = new CreateCompoundAction(viewer, graphicalFeatureModel); clAction = new CreateLayerAction(viewer, graphicalFeatureModel); ======= cAction = new CreateFeatureAboveAction(viewer, fInput); clAction = new CreateFeatureBelowAction(viewer, fInput); csAction = new CreateSiblingAction(viewer, graphicalFeatureModel); >>>>>>> cAction = new CreateFeatureAboveAction(viewer, graphicalFeatureModel); clAction = new CreateFeatureBelowAction(viewer, graphicalFeatureModel); csAction = new CreateSiblingAction(viewer, graphicalFeatureModel);
<<<<<<< writeSomeData(conn, table1, 2000, 50); ======= BatchWriter bw = conn.createBatchWriter(table1, new BatchWriterConfig()); for (int rows = 0; rows < 2000; rows++) { Mutation m = new Mutation(Integer.toString(rows)); for (int cols = 0; cols < 50; cols++) { String value = Integer.toString(cols); m.put(value, "", value); } bw.addMutation(m); } bw.close(); conn.tableOperations().flush(table1, null, null, true); >>>>>>> writeSomeData(conn, table1, 2000, 50); conn.tableOperations().flush(table1, null, null, true); <<<<<<< writeSomeData(conn, table1, 2000, 50); ======= BatchWriter bw = conn.createBatchWriter(table1, new BatchWriterConfig()); for (int rows = 0; rows < 2000; rows++) { Mutation m = new Mutation(Integer.toString(rows)); for (int cols = 0; cols < 50; cols++) { String value = Integer.toString(cols); m.put(value, "", value); } bw.addMutation(m); } bw.close(); conn.tableOperations().flush(table1, null, null, true); >>>>>>> writeSomeData(conn, table1, 2000, 50); conn.tableOperations().flush(table1, null, null, true);
<<<<<<< ======= /** * Specifies whether the literals <b>True</b> and <b>False</b> should be included in the created formula.</br> Default values is {@code true} (values will * be included). */ >>>>>>> /** * Specifies whether the literals <b>True</b> and <b>False</b> should be included in the created formula.</br> Default values is {@code true} (values will * be included). */ <<<<<<< final List<Node> clauses = createConstraintNodes(constraint, new LinkedList<Node>()); if ((cnfType != CNFType.Regular) && (clauses.size() == 1)) { ======= return createConstraintNode(constraint, true); } /** * Creates the node for a single constraint of the feature model. * * @param constraint constraint to transform * @param positive false to negate the node of the constraint before adding * @return the transformed node */ public Node createConstraintNode(IConstraint constraint, boolean positive) { final List<Node> clauses = createConstraintNodes(constraint, new LinkedList<Node>(), positive); if ((cnfType != CNFType.Regular) && (clauses.size() == 1)) { >>>>>>> return createConstraintNode(constraint, true); } /** * Creates the node for a single constraint of the feature model. * * @param constraint constraint to transform * @param positive false to negate the node of the constraint before adding * @return the transformed node */ public Node createConstraintNode(IConstraint constraint, boolean positive) { final List<Node> clauses = createConstraintNodes(constraint, new LinkedList<Node>(), positive); if ((cnfType != CNFType.Regular) && (clauses.size() == 1)) { <<<<<<< ======= private Node removeFeatures(final Node[] nodeArray, IMonitor monitor) { if ((excludedFeatureNames != null) && !excludedFeatureNames.isEmpty()) { final FeatureRemover remover = new FeatureRemover(new And(nodeArray), excludedFeatureNames, includeBooleanValues, cnfType == CNFType.Regular); return remover.createNewClauseList(LongRunningWrapper.runMethod(remover, monitor)); } else { return new And(nodeArray); } } >>>>>>> <<<<<<< ======= this.excludedFeatureNames = excludedFeatureNames; traceModel = isRecordingTraceModel() ? new FeatureModelToNodeTraceModel() : null; // Reset the trace model. >>>>>>> traceModel = isRecordingTraceModel() ? new FeatureModelToNodeTraceModel() : null; // Reset the trace model.
<<<<<<< TableId tableId = tls.extent.getTableId(); TableConfiguration tableConf = this.master.getConfigurationFactory() .getTableConfiguration(tableId); ======= String tableId = tls.extent.getTableId(); TableConfiguration tableConf = this.master.getConfigurationFactory().getTableConfiguration(tableId); >>>>>>> TableId tableId = tls.extent.getTableId(); TableConfiguration tableConf = this.master.getConfigurationFactory().getTableConfiguration(tableId); <<<<<<< Master.log.info("Removing entry {}", entry); BatchWriter bw = this.master.getContext().createBatchWriter(table, new BatchWriterConfig()); ======= Master.log.info("Removing entry " + entry); BatchWriter bw = this.master.getConnector().createBatchWriter(table, new BatchWriterConfig()); >>>>>>> Master.log.info("Removing entry {}", entry); BatchWriter bw = this.master.getContext().createBatchWriter(table, new BatchWriterConfig()); <<<<<<< Range scanRange = new Range(TabletsSection.getRow(range.getTableId(), start), false, stopRow, false); ======= Range scanRange = new Range(KeyExtent.getMetadataEntry(range.getTableId(), start), false, stopRow, false); >>>>>>> Range scanRange = new Range(TabletsSection.getRow(range.getTableId(), start), false, stopRow, false);
<<<<<<< ======= /** The solver factory used to create the oracle. */ private final SatSolverFactory solverFactory; /** * Constructs a new instance of this class. */ public MusFeatureModelExplanationCreatorFactory() { this(null); } /** * Constructs a new instance of this class. * * @param solverFactory the solver factory used to create the oracle */ public MusFeatureModelExplanationCreatorFactory(SatSolverFactory solverFactory) { if (solverFactory == null) { solverFactory = SatSolverFactory.getDefault(); } this.solverFactory = solverFactory; } >>>>>>> /** The solver factory used to create the oracle. */ private final SatSolverFactory solverFactory; /** * Constructs a new instance of this class. */ public MusFeatureModelExplanationCreatorFactory() { this(null); } /** * Constructs a new instance of this class. * * @param solverFactory the solver factory used to create the oracle */ public MusFeatureModelExplanationCreatorFactory(SatSolverFactory solverFactory) { if (solverFactory == null) { solverFactory = SatSolverFactory.getDefault(); } this.solverFactory = solverFactory; } <<<<<<< public DeadFeatureExplanationCreator getDeadFeatureExplanationCreator(IFeatureModel fm) { return new MusDeadFeatureExplanationCreator(fm); } @Override ======= >>>>>>> <<<<<<< return new MusFalseOptionalFeatureExplanationCreator(); } @Override public FalseOptionalFeatureExplanationCreator getFalseOptionalFeatureExplanationCreator(IFeatureModel fm) { return new MusFalseOptionalFeatureExplanationCreator(fm); ======= return new MusFalseOptionalFeatureExplanationCreator(solverFactory); >>>>>>> return new MusFalseOptionalFeatureExplanationCreator(solverFactory);
<<<<<<< import org.apache.accumulo.core.client.impl.AcceptableThriftTableOperationException; import org.apache.accumulo.core.client.impl.Tables; ======= >>>>>>> import org.apache.accumulo.core.client.impl.AcceptableThriftTableOperationException; <<<<<<< public TableRangeOp(MergeInfo.Operation op, String tableId, Text startRow, Text endRow) throws AcceptableThriftTableOperationException { ======= @Override public long isReady(long tid, Master env) throws Exception { return Utils.reserveNamespace(getNamespaceId(env), tid, false, true, TableOperation.MERGE) + Utils.reserveTable(tableId, tid, true, true, TableOperation.MERGE); } >>>>>>> @Override public long isReady(long tid, Master env) throws Exception { return Utils.reserveNamespace(getNamespaceId(env), tid, false, true, TableOperation.MERGE) + Utils.reserveTable(tableId, tid, true, true, TableOperation.MERGE); } <<<<<<< env.clearMergeState(tableId); Utils.unreserveNamespace(namespaceId, tid, false); ======= env.clearMergeState(tableIdText); >>>>>>> env.clearMergeState(tableId); Utils.unreserveNamespace(namespaceId, tid, false);
<<<<<<< import de.ovgu.featureide.fm.attributes.base.impl.ExtendedFeatureModelFactory; ======= import de.ovgu.featureide.fm.attributes.base.impl.ExtendedFeatureModel; >>>>>>> import de.ovgu.featureide.fm.attributes.base.impl.ExtendedFeatureModel; import de.ovgu.featureide.fm.attributes.base.impl.ExtendedFeatureModelFactory; <<<<<<< public class XmlExtendedFeatureModelFormat extends XmlFeatureModelFormat implements IFeatureModelFormat { ======= /** * Implements the {@link IFeatureModelFormat} and represents the format used to read and write {@link ExtendedFeatureModel} to XML files. * * @see IFeatureModelFormat * * @author Joshua Sprey * @author Chico Sundermann */ public class XmlExtendedFeatureModelFormat extends AXMLFormat<IFeatureModel> implements IFeatureModelFormat { >>>>>>> /** * Implements the {@link IFeatureModelFormat} and represents the format used to read and write {@link ExtendedFeatureModel} to XML files. * * @see IFeatureModelFormat * * @author Joshua Sprey * @author Chico Sundermann */ public class XmlExtendedFeatureModelFormat extends XmlFeatureModelFormat implements IFeatureModelFormat {
<<<<<<< import de.ovgu.featureide.fm.core.analysis.cnf.formula.FeatureModelFormula; ======= import de.ovgu.featureide.fm.core.Logger; >>>>>>> import de.ovgu.featureide.fm.core.Logger; <<<<<<< import de.ovgu.featureide.fm.core.io.IPersistentFormat; import de.ovgu.featureide.fm.core.io.manager.FeatureModelManager; ======= import de.ovgu.featureide.fm.core.io.FileSystem; import de.ovgu.featureide.fm.core.io.manager.AFileManager; >>>>>>> import de.ovgu.featureide.fm.core.io.FileSystem; import de.ovgu.featureide.fm.core.io.manager.AFileManager; <<<<<<< import de.ovgu.featureide.fm.core.io.manager.FileManager; import de.ovgu.featureide.fm.core.io.manager.IFileManager; import de.ovgu.featureide.fm.core.io.manager.SimpleFileHandler; import de.ovgu.featureide.fm.core.job.IRunner; ======= import de.ovgu.featureide.fm.core.io.manager.IFeatureModelManager; import de.ovgu.featureide.fm.core.job.IRunner; import de.ovgu.featureide.fm.core.job.JobStartingStrategy; import de.ovgu.featureide.fm.core.job.JobToken; >>>>>>> import de.ovgu.featureide.fm.core.io.manager.IFeatureModelManager; import de.ovgu.featureide.fm.core.job.IRunner; import de.ovgu.featureide.fm.core.job.JobStartingStrategy; import de.ovgu.featureide.fm.core.job.JobToken; <<<<<<< private IRunner<Boolean> analyzeJob; private FeatureModelAnalyzer varAnalyzer; private boolean waiting = false; ======= private final JobToken analysisToken = LongRunningWrapper.createToken(JobStartingStrategy.CANCEL_WAIT_ONE); >>>>>>> private final JobToken analysisToken = LongRunningWrapper.createToken(JobStartingStrategy.CANCEL_WAIT_ONE); <<<<<<< public FeatureDiagramEditor(IFileManager<IFeatureModel> fmManager, boolean isEditable) { super(fmManager); graphicalFeatureModel = getGrapicalFeatureModel(getFeatureModel()); // 1. Check if the fmManager exists and is not a VirtualFileManager instance (path returns null) // 2. read-only feature model is currently only a view on the editable feature model and not persistent if ((fmManager != null) && (fmManager.getPath() != null)) { extraPath = FileManager.constructExtraPath(fmManager.getPath(), format); FileHandler.load(extraPath, graphicalFeatureModel, format); fmManager.addListener(this); } else { extraPath = null; } ======= public FeatureDiagramEditor(IFeatureModelManager fmManager, IGraphicalFeatureModel gfm, boolean isEditable) { super(fmManager, gfm); >>>>>>> public FeatureDiagramEditor(IFeatureModelManager fmManager, IGraphicalFeatureModel gfm, boolean isEditable) { super(fmManager, gfm); <<<<<<< final FeatureModelAnalyzer analyser = FeatureModelManager.getAnalyzer(getFeatureModel()); setActiveExplanation(analyser.isValid() ? analyser.getExplanation(primary.getModel().getObject()) : analyser.getVoidFeatureModelExplanation()); ======= final FeatureModelAnalyzer analyser = getFeatureModel().editObject().getAnalyser(); setActiveExplanation(analyser.valid() ? analyser.getExplanation(primary.getModel().getObject()) : analyser.getVoidFeatureModelExplanation()); >>>>>>> final FeatureModelAnalyzer analyser = getFeatureModel().getVariableFormula().getAnalyzer(); setActiveExplanation(analyser.isValid() ? analyser.getExplanation(primary.getModel().getObject()) : analyser.getVoidFeatureModelExplanation()); <<<<<<< private void refreshGraphics(final Map<IFeatureModelElement, Object> changedAttributes) { ======= public void refreshGraphics(final HashMap<Object, Object> changedAttributes) { >>>>>>> public void refreshGraphics(final Map<IFeatureModelElement, Object> changedAttributes) { <<<<<<< if (extraPath != null) { SimpleFileHandler.save(extraPath, graphicalFeatureModel, format); } ======= >>>>>>> <<<<<<< case MODEL_DATA_OVERRIDDEN: if (extraPath != null) { SimpleFileHandler.save(extraPath, graphicalFeatureModel, format); } ======= case MODEL_DATA_LOADED: case MODEL_DATA_OVERWRITTEN: >>>>>>> case MODEL_DATA_OVERWRITTEN: <<<<<<< if (extraPath != null) { SimpleFileHandler.load(extraPath, graphicalFeatureModel, format); } ======= >>>>>>> <<<<<<< if (extraPath != null) { SimpleFileHandler.save(extraPath, graphicalFeatureModel, format); } ======= setDirty(); >>>>>>>
<<<<<<< import de.ovgu.featureide.fm.core.AbstractCorePlugin; import de.ovgu.featureide.fm.core.FMCorePlugin; import de.ovgu.featureide.fm.core.base.IFeatureModel; import de.ovgu.featureide.fm.core.configuration.Configuration; import de.ovgu.featureide.fm.core.configuration.ConfigurationWriter; ======= import de.ovgu.featureide.fm.core.FeatureModel; >>>>>>> import de.ovgu.featureide.fm.core.AbstractCorePlugin; import de.ovgu.featureide.fm.core.FMCorePlugin; import de.ovgu.featureide.fm.core.base.IFeatureModel; import de.ovgu.featureide.fm.core.configuration.Configuration; import de.ovgu.featureide.fm.core.configuration.ConfigurationWriter; <<<<<<< protected final IFeatureModel featureModel; ======= protected FeatureModel featureModel; >>>>>>> protected final IFeatureModel featureModel; <<<<<<< /** * @param model */ public QuickFixMissingConfigurations(IFeatureModel model) { ======= public QuickFixMissingConfigurations(FeatureModel model) { >>>>>>> public QuickFixMissingConfigurations(IFeatureModel model) {
<<<<<<< import de.ovgu.featureide.fm.core.base.IFeatureModel; ======= import de.ovgu.featureide.fm.core.FeatureModel; import de.ovgu.featureide.fm.core.color.FeatureColorManager; >>>>>>> import de.ovgu.featureide.fm.core.base.IFeatureModel; import de.ovgu.featureide.fm.core.color.FeatureColorManager; <<<<<<< protected boolean action(IFeatureModel fm, String collName) { if (fm.getGraphicRepresenation().getColorschemeTable().getSelectedColorscheme() != index) { fm.getGraphicRepresenation().getColorschemeTable().setSelectedColorscheme(index); } else { fm.getGraphicRepresenation().getColorschemeTable().setEmptyColorscheme(); } ======= protected boolean action(FeatureModel fm, String collName) { FeatureColorManager.setActive(fm, collName); >>>>>>> protected boolean action(IFeatureModel fm, String collName) { FeatureColorManager.setActive(fm, collName);
<<<<<<< import de.ovgu.featureide.fm.core.analysis.ConstraintProperties; import de.ovgu.featureide.fm.core.analysis.ConstraintProperties.ConstraintDeadStatus; import de.ovgu.featureide.fm.core.analysis.ConstraintProperties.ConstraintFalseOptionalStatus; import de.ovgu.featureide.fm.core.analysis.ConstraintProperties.ConstraintRedundancyStatus; import de.ovgu.featureide.fm.core.analysis.FeatureProperties; import de.ovgu.featureide.fm.core.analysis.FeatureProperties.FeatureDeterminedStatus; import de.ovgu.featureide.fm.core.analysis.FeatureProperties.FeatureParentStatus; import de.ovgu.featureide.fm.core.analysis.FeatureProperties.FeatureSelectionStatus; ======= import de.ovgu.featureide.Commons; >>>>>>> import de.ovgu.featureide.Commons; import de.ovgu.featureide.fm.core.analysis.ConstraintProperties; import de.ovgu.featureide.fm.core.analysis.ConstraintProperties.ConstraintDeadStatus; import de.ovgu.featureide.fm.core.analysis.ConstraintProperties.ConstraintFalseOptionalStatus; import de.ovgu.featureide.fm.core.analysis.ConstraintProperties.ConstraintRedundancyStatus; import de.ovgu.featureide.fm.core.analysis.FeatureProperties; import de.ovgu.featureide.fm.core.analysis.FeatureProperties.FeatureDeterminedStatus; import de.ovgu.featureide.fm.core.analysis.FeatureProperties.FeatureParentStatus; import de.ovgu.featureide.fm.core.analysis.FeatureProperties.FeatureSelectionStatus; <<<<<<< protected static File MODEL_FILE_FOLDER = getFolder(); ======= protected static File MODEL_FILE_FOLDER = Commons.getRemoteOrLocalFolder("analyzefeaturemodels/"); >>>>>>> protected static File MODEL_FILE_FOLDER = Commons.getRemoteOrLocalFolder("analyzefeaturemodels/"); <<<<<<< private static IFeatureModel FM_test_1 = init("test_1.xml"); private static IFeature FM1_F1 = FM_test_1.getFeature("F1"); private static IFeature FM1_F2 = FM_test_1.getFeature("F2"); private static IConstraint FM1_C1 = FM_test_1.getConstraints().get(0); private static Map<IFeatureModelElement, Object> FM1_DATA = FeatureModelManager.getAnalyzer(FM_test_1).analyzeFeatureModel(null); private static IFeatureModel FM_test_2 = init("test_2.xml"); private static IFeature FM2_F1 = FM_test_2.getFeature("F1"); private static IFeature FM2_F2 = FM_test_2.getFeature("F2"); private static IFeature FM2_F3 = FM_test_2.getFeature("F3"); private static IConstraint FM2_C1 = FM_test_2.getConstraints().get(0); private static IConstraint FM2_C2 = FM_test_2.getConstraints().get(1); private static IConstraint FM2_C3 = FM_test_2.getConstraints().get(2); private static Map<IFeatureModelElement, Object> FM2_DATA = FeatureModelManager.getAnalyzer(FM_test_2).analyzeFeatureModel(null); private static IFeatureModel FM_test_3 = init("test_3.xml"); private static IFeature FM3_F2 = FM_test_3.getFeature("F2"); private static IFeature FM3_F3 = FM_test_3.getFeature("F3"); private static IConstraint FM3_C1 = FM_test_3.getConstraints().get(0); private static Map<IFeatureModelElement, Object> FM3_DATA = FeatureModelManager.getAnalyzer(FM_test_3).analyzeFeatureModel(null); private static IFeatureModel FM_test_4 = init("test_4.xml"); private static IFeature FM4_F1 = FM_test_4.getFeature("I"); private static IFeature FM4_F2 = FM_test_4.getFeature("D"); private static IFeature FM4_F3 = FM_test_4.getFeature("E"); private static IFeature FM4_F4 = FM_test_4.getFeature("K"); private static IFeature FM4_F5 = FM_test_4.getFeature("L"); private static IFeature FM4_F6 = FM_test_4.getFeature("N"); private static IFeature FM4_F7 = FM_test_4.getFeature("P"); private static IFeature FM4_F8 = FM_test_4.getFeature("M"); private static IFeature FM4_F9 = FM_test_4.getFeature("C"); private static IFeature FM4_F10 = FM_test_4.getFeature("J"); private static Map<IFeatureModelElement, Object> FM4_DATA = FeatureModelManager.getAnalyzer(FM_test_4).analyzeFeatureModel(null); private static IFeatureModel FM_test_7 = init("test_7.xml"); private static IFeature FM7_F1 = FM_test_7.getFeature("H"); private static IConstraint FM7_C1 = FM_test_7.getConstraints().get(0); private static Map<IFeatureModelElement, Object> FM7_DATA = FeatureModelManager.getAnalyzer(FM_test_7).analyzeFeatureModel(null); private static IFeatureModel FM_test_8 = init("test_8.xml"); private static IFeature FM8_F1 = FM_test_8.getFeature("B"); private static IFeature FM8_F2 = FM_test_8.getFeature("C"); private static Map<IFeatureModelElement, Object> FM8_DATA = FeatureModelManager.getAnalyzer(FM_test_8).analyzeFeatureModel(null); /** * @return */ private static File getFolder() { File folder = new File("/home/itidbrun/TeamCity/buildAgent/work/featureide/tests/de.ovgu.featureide.fm.core-test/src/analyzefeaturemodels/"); if (!folder.canRead()) { folder = new File(ClassLoader.getSystemResource("analyzefeaturemodels").getPath()); } return folder; } private static final IFeatureModel init(String name) { ======= private final IFeatureModel FM_test_1 = init("test_1.xml"); private final IFeature FM1_F1 = FM_test_1.getFeature("F1"); private final IFeature FM1_F2 = FM_test_1.getFeature("F2"); private final IConstraint FM1_C1 = FM_test_1.getConstraints().get(0); private final HashMap<Object, Object> FM1_DATA = FM_test_1.getAnalyser().analyzeFeatureModel(null); private final IFeatureModel FM_test_2 = init("test_2.xml"); private final IFeature FM2_F1 = FM_test_2.getFeature("F1"); private final IFeature FM2_F2 = FM_test_2.getFeature("F2"); private final IFeature FM2_F3 = FM_test_2.getFeature("F3"); private final IConstraint FM2_C1 = FM_test_2.getConstraints().get(0); private final IConstraint FM2_C2 = FM_test_2.getConstraints().get(1); private final IConstraint FM2_C3 = FM_test_2.getConstraints().get(2); private final HashMap<Object, Object> FM2_DATA = FM_test_2.getAnalyser().analyzeFeatureModel(null); private final IFeatureModel FM_test_3 = init("test_3.xml"); private final IFeature FM3_F2 = FM_test_3.getFeature("F2"); private final IFeature FM3_F3 = FM_test_3.getFeature("F3"); private final IConstraint FM3_C1 = FM_test_3.getConstraints().get(0); private final HashMap<Object, Object> FM3_DATA = FM_test_3.getAnalyser().analyzeFeatureModel(null); private final IFeatureModel FM_test_4 = init("test_4.xml"); private final IFeature FM4_F1 = FM_test_4.getFeature("I"); private final IFeature FM4_F2 = FM_test_4.getFeature("D"); private final IFeature FM4_F3 = FM_test_4.getFeature("E"); private final IFeature FM4_F4 = FM_test_4.getFeature("K"); private final IFeature FM4_F5 = FM_test_4.getFeature("L"); private final IFeature FM4_F6 = FM_test_4.getFeature("N"); private final IFeature FM4_F7 = FM_test_4.getFeature("P"); private final IFeature FM4_F8 = FM_test_4.getFeature("M"); private final IFeature FM4_F9 = FM_test_4.getFeature("C"); private final IFeature FM4_F10 = FM_test_4.getFeature("J"); private final HashMap<Object, Object> FM4_DATA = FM_test_4.getAnalyser().analyzeFeatureModel(null); private final IFeatureModel FM_test_7 = init("test_7.xml"); private final IFeature FM7_F1 = FM_test_7.getFeature("H"); private final IConstraint FM7_C1 = FM_test_7.getConstraints().get(0); private final HashMap<Object, Object> FM7_DATA = FM_test_7.getAnalyser().analyzeFeatureModel(null); private final IFeatureModel FM_test_8 = init("test_8.xml"); private final IFeature FM8_F1 = FM_test_8.getFeature("B"); private final IFeature FM8_F2 = FM_test_8.getFeature("C"); private final HashMap<Object, Object> FM8_DATA = FM_test_8.getAnalyser().analyzeFeatureModel(null); private final IFeatureModel init(String name) { >>>>>>> private static IFeatureModel FM_test_1 = init("test_1.xml"); private static IFeature FM1_F1 = FM_test_1.getFeature("F1"); private static IFeature FM1_F2 = FM_test_1.getFeature("F2"); private static IConstraint FM1_C1 = FM_test_1.getConstraints().get(0); private static Map<IFeatureModelElement, Object> FM1_DATA = FeatureModelManager.getAnalyzer(FM_test_1).analyzeFeatureModel(null); private static IFeatureModel FM_test_2 = init("test_2.xml"); private static IFeature FM2_F1 = FM_test_2.getFeature("F1"); private static IFeature FM2_F2 = FM_test_2.getFeature("F2"); private static IFeature FM2_F3 = FM_test_2.getFeature("F3"); private static IConstraint FM2_C1 = FM_test_2.getConstraints().get(0); private static IConstraint FM2_C2 = FM_test_2.getConstraints().get(1); private static IConstraint FM2_C3 = FM_test_2.getConstraints().get(2); private static Map<IFeatureModelElement, Object> FM2_DATA = FeatureModelManager.getAnalyzer(FM_test_2).analyzeFeatureModel(null); private static IFeatureModel FM_test_3 = init("test_3.xml"); private static IFeature FM3_F2 = FM_test_3.getFeature("F2"); private static IFeature FM3_F3 = FM_test_3.getFeature("F3"); private static IConstraint FM3_C1 = FM_test_3.getConstraints().get(0); private static Map<IFeatureModelElement, Object> FM3_DATA = FeatureModelManager.getAnalyzer(FM_test_3).analyzeFeatureModel(null); private static IFeatureModel FM_test_4 = init("test_4.xml"); private static IFeature FM4_F1 = FM_test_4.getFeature("I"); private static IFeature FM4_F2 = FM_test_4.getFeature("D"); private static IFeature FM4_F3 = FM_test_4.getFeature("E"); private static IFeature FM4_F4 = FM_test_4.getFeature("K"); private static IFeature FM4_F5 = FM_test_4.getFeature("L"); private static IFeature FM4_F6 = FM_test_4.getFeature("N"); private static IFeature FM4_F7 = FM_test_4.getFeature("P"); private static IFeature FM4_F8 = FM_test_4.getFeature("M"); private static IFeature FM4_F9 = FM_test_4.getFeature("C"); private static IFeature FM4_F10 = FM_test_4.getFeature("J"); private static Map<IFeatureModelElement, Object> FM4_DATA = FeatureModelManager.getAnalyzer(FM_test_4).analyzeFeatureModel(null); private static IFeatureModel FM_test_7 = init("test_7.xml"); private static IFeature FM7_F1 = FM_test_7.getFeature("H"); private static IConstraint FM7_C1 = FM_test_7.getConstraints().get(0); private static Map<IFeatureModelElement, Object> FM7_DATA = FeatureModelManager.getAnalyzer(FM_test_7).analyzeFeatureModel(null); private static IFeatureModel FM_test_8 = init("test_8.xml"); private static IFeature FM8_F1 = FM_test_8.getFeature("B"); private static IFeature FM8_F2 = FM_test_8.getFeature("C"); private static Map<IFeatureModelElement, Object> FM8_DATA = FeatureModelManager.getAnalyzer(FM_test_8).analyzeFeatureModel(null); private static final IFeatureModel init(String name) { <<<<<<< fm = FeatureModelManager.load(f.toPath()); if (fm != null) { ======= fm = FeatureModelManager.load(f.toPath()).getObject(); if (fm != null) { >>>>>>> fm = FeatureModelManager.load(f.toPath()); if (fm != null) {
<<<<<<< ======= graphicalFeatureModel = createGraphicalFeatureModel(); modelLayout = createFeatureModelLayout(); analyser = createAnalyser(); >>>>>>> analyser = createAnalyser(); <<<<<<< ======= analyser = createAnalyser(); >>>>>>> analyser = createAnalyser();
<<<<<<< private void callConfigurationGenerator(IFeatureModel fm, int solutionCount, IMonitor monitor) { final AdvancedNodeCreator advancedNodeCreator = new AdvancedNodeCreator(fm); ======= private void callConfigurationGenerator(IFeatureModel fm, int solutionCount, WorkMonitor monitor) { final AdvancedNodeCreator advancedNodeCreator = new AdvancedNodeCreator(fm, new AbstractFeatureFilter()); >>>>>>> private void callConfigurationGenerator(IFeatureModel fm, int solutionCount, IMonitor monitor) { final AdvancedNodeCreator advancedNodeCreator = new AdvancedNodeCreator(fm, new AbstractFeatureFilter()); <<<<<<< SatInstance satInstance = new SatInstance(createNodes, FeatureUtils.getFeatureNamesPreorder(fm)); PairWiseConfigurationGenerator gen = getGenerator(satInstance, solutionCount); exec(satInstance, gen, monitor); ======= SatInstance solver = new SatInstance(createNodes); PairWiseConfigurationGenerator gen = getGenerator(solver, solutionCount); exec(solver, gen, monitor); >>>>>>> SatInstance satInstance = new SatInstance(createNodes); PairWiseConfigurationGenerator gen = getGenerator(satInstance, solutionCount); exec(satInstance, gen, monitor);
<<<<<<< import de.ovgu.featureide.fm.core.base.impl.FormatManager; ======= import de.ovgu.featureide.fm.core.io.ExternalChangeListener; >>>>>>> import de.ovgu.featureide.fm.core.base.impl.FormatManager; import de.ovgu.featureide.fm.core.io.ExternalChangeListener; <<<<<<< @Override public void addListener(IEventListener listener) { eventManager.addListener(listener); } protected abstract T copyObject(T oldObject); @Override public void dispose() { removeInstance(Paths.get(absolutePath)); persistentObject = null; variableObject = null; ======= public T getObject() { return persistentObject; >>>>>>> @Override public void addListener(IEventListener listener) { eventManager.addListener(listener); } protected abstract T copyObject(T oldObject); public T getObject() { return persistentObject; <<<<<<< @Override public void removeListener(IEventListener listener) { eventManager.removeListener(listener); ======= // TODO Quickfix for #501. Should be implemented by overriding the current instance pointer. public void override() { synchronized (syncObject) { final String write = format.getInstance().write(localObject); format.getInstance().read(variableObject, write); format.getInstance().read(persistentObject, write); // variableObject = copyObject(localObject); // persistentObject = copyObject(localObject); } fireEvent(new FeatureIDEEvent(variableObject, EventType.MODEL_DATA_OVERRIDDEN)); } /** * Compares two object for equality.<br/> * Subclasses should override (implement) this method. * * @param o1 First object. * @param o2 Second object. * @return {@code true} if objects are considered equal, {@code false} otherwise. */ protected boolean compareObjects(T o1, T o2) { final String s1 = format.getInstance().write(o1); final String s2 = format.getInstance().write(o2); return s1.equals(s2); >>>>>>> // TODO Quickfix for #501. Should be implemented by overriding the current instance pointer. public void override() { synchronized (syncObject) { if (modifying) { return; } final String write = format.getInstance().write(localObject); format.getInstance().read(variableObject, write); format.getInstance().read(persistentObject, write); // variableObject = copyObject(localObject); // persistentObject = copyObject(localObject); } fireEvent(new FeatureIDEEvent(variableObject, EventType.MODEL_DATA_OVERRIDDEN)); } @Override public void removeListener(IEventListener listener) { eventManager.removeListener(listener); } /** * Compares two object for equality.<br/> * Subclasses should override (implement) this method. * * @param o1 First object. * @param o2 Second object. * @return {@code true} if objects are considered equal, {@code false} otherwise. */ protected boolean compareObjects(T o1, T o2) { final String s1 = format.getInstance().write(o1); final String s2 = format.getInstance().write(o2); return s1.equals(s2);
<<<<<<< public class FeatureProject extends de.ovgu.featureide.fm.core.FeatureProject implements IFeatureProject, IResourceChangeListener, IBuilderMarkerHandler { ======= public class FeatureProject extends BuilderMarkerHandler implements IFeatureProject, IResourceChangeListener, IEventListener { >>>>>>> public class FeatureProject extends de.ovgu.featureide.fm.core.FeatureProject implements IFeatureProject, IResourceChangeListener, IBuilderMarkerHandler, IEventListener { <<<<<<< private final Configuration config = new Configuration(model); private final FileHandler<Configuration> handler = new FileHandler<>(config); ======= private final Configuration config = new Configuration(model, Configuration.PARAM_LAZY); >>>>>>> private final Configuration config = new Configuration(model); <<<<<<< final Configuration config = new Configuration(featureModelManager.getObject()); final FileHandler<Configuration> reader = new FileHandler<>(config); ======= final Configuration config = new Configuration(featureModelManager.getObject(), false, false); >>>>>>> final Configuration config = new Configuration(featureModelManager.getObject()); <<<<<<< reader.read(Paths.get(file.getLocationURI()), ConfigurationManager.getFormat(file.getName())); final ConfigurationPropagator propagator = de.ovgu.featureide.fm.core.FeatureProject.getPropagator(config, true); if (!LongRunningWrapper.runMethod(propagator.isValid())) { ======= final ProblemList lastProblems = FileHandler.load(Paths.get(file.getLocationURI()), config, ConfigFormatManager.getInstance()); if (!config.isValid()) { >>>>>>> final ProblemList lastProblems = FileHandler.load(Paths.get(file.getLocationURI()), config, ConfigFormatManager.getInstance()); final ConfigurationPropagator propagator = de.ovgu.featureide.fm.core.FeatureProject.getPropagator(config, true); if (!LongRunningWrapper.runMethod(propagator.isValid())) { <<<<<<< final Configuration configuration = new Configuration(featureModelManager.getObject()); final FileHandler<Configuration> reader = new FileHandler<>(configuration); ======= final Configuration configuration = new Configuration(featureModelManager.getObject(), Configuration.PARAM_IGNOREABSTRACT); >>>>>>> final Configuration configuration = new Configuration(featureModelManager.getObject()); <<<<<<< public void createBuilderMarker(IResource resource, String message, int lineNumber, int severity) { EclipseMarkerHandler.createBuilderMarker((resource != null) ? resource : project, message, lineNumber, severity); } public void deleteBuilderMarkers(IResource resource, int depth) { EclipseMarkerHandler.deleteBuilderMarkers(resource, depth); } public void createConfigurationMarker(IResource resource, String message, int lineNumber, int severity) { EclipseMarkerHandler.createConfigurationMarker(resource, message, lineNumber, severity); } public void deleteConfigurationMarkers(IResource resource, int depth) { EclipseMarkerHandler.deleteConfigurationMarkers(resource, depth); } ======= @Override public void propertyChange(FeatureIDEEvent event) { switch (event.getEventType()) { case MODEL_DATA_OVERRIDDEN: Job job = new Job(LOAD_MODEL) { protected IStatus run(IProgressMonitor monitor) { if (loadModel()) { final IComposerExtensionClass composerExtension = getComposer(); if (composerExtension.isInitialized()) { composerExtension.postModelChanged(); if (!configurationUpdate) { checkConfigurations(getAllConfigurations()); } checkFeatureCoverage(); return Status.OK_STATUS; } } return Status.CANCEL_STATUS; } }; job.setPriority(Job.INTERACTIVE); job.schedule(); break; default: break; } } >>>>>>> public void createBuilderMarker(IResource resource, String message, int lineNumber, int severity) { EclipseMarkerHandler.createBuilderMarker((resource != null) ? resource : project, message, lineNumber, severity); } public void deleteBuilderMarkers(IResource resource, int depth) { EclipseMarkerHandler.deleteBuilderMarkers(resource, depth); } public void createConfigurationMarker(IResource resource, String message, int lineNumber, int severity) { EclipseMarkerHandler.createConfigurationMarker(resource, message, lineNumber, severity); } public void deleteConfigurationMarkers(IResource resource, int depth) { EclipseMarkerHandler.deleteConfigurationMarkers(resource, depth); } @Override public void propertyChange(FeatureIDEEvent event) { switch (event.getEventType()) { case MODEL_DATA_OVERRIDDEN: Job job = new Job(LOAD_MODEL) { protected IStatus run(IProgressMonitor monitor) { if (loadModel()) { final IComposerExtensionClass composerExtension = getComposer(); if (composerExtension.isInitialized()) { composerExtension.postModelChanged(); if (!configurationUpdate) { checkConfigurations(getAllConfigurations()); } checkFeatureCoverage(); return Status.OK_STATUS; } } return Status.CANCEL_STATUS; } }; job.setPriority(Job.INTERACTIVE); job.schedule(); break; default: break; } }
<<<<<<< import de.ovgu.featureide.fm.core.configuration.IConfiguration; ======= 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.configuration.Configuration; import de.ovgu.featureide.fm.core.configuration.ConfigurationPropagatorJobWrapper.IConfigJob; >>>>>>> import de.ovgu.featureide.fm.core.configuration.IConfiguration; import de.ovgu.featureide.fm.core.color.ColorPalette; import de.ovgu.featureide.fm.core.color.FeatureColor; import de.ovgu.featureide.fm.core.color.FeatureColorManager;
<<<<<<< public final IFeature feature; ======= private String name; private boolean mandatory; private boolean concret; private boolean and; private boolean multiple; private boolean hidden; private boolean constraintSelected; private List<Constraint> partOfConstraints = new LinkedList<Constraint>(); private FeatureStatus status; private FeatureModel featureModel; private FMPoint location; private String description; >>>>>>> public final IFeature feature; <<<<<<< FeatureUtils.setDescription(feature, description); ======= this.description = description; } public Feature(FeatureModel featureModel) { this(featureModel, UNKNOWN); } public Feature(FeatureModel featureModel, String name) { this.featureModel = featureModel; this.name = name; this.mandatory = false; this.concret = true; this.and = true; this.multiple = false; this.hidden = false; this.constraintSelected = false; this.status = FeatureStatus.NORMAL; this.location = new FMPoint(0, 0); this.description = null; this.parent = null; sourceConnections.add(parentConnection); } protected Feature(Feature feature, FeatureModel featureModel, boolean complete) { this.featureModel = featureModel; this.name = feature.name; this.mandatory = feature.mandatory; this.concret = feature.concret; this.and = feature.and; this.multiple = feature.multiple; this.hidden = feature.hidden; this.constraintSelected = feature.constraintSelected; this.status = feature.status; this.description = feature.description; if (complete) { this.location = new FMPoint(feature.location.getX(), feature.location.getY()); } else { this.location = null; } this.featureModel.addFeature(this); for (Feature child : feature.children) { Feature thisChild = this.featureModel.getFeature(child.getName()); if (thisChild == null) { thisChild = child.clone(featureModel, complete); } this.featureModel.addFeature(thisChild); children.add(thisChild); } if (feature.parent != null) { this.parent = this.featureModel.getFeature(feature.parent.getName()); } >>>>>>> FeatureUtils.setDescription(feature, description); <<<<<<< /** * <b>This class and all it's methods are deprecated and should <i>only</i> be used for compatibility reasons</b> * </br>Internally, the <code>de.ovgu.featureide.fm.core.Feature</code> class uses a delegiation to an underlying * {@link IFeature IFeature interface}.<br/><br/> * Instead of this method you should use<br/> * <code> * FeatureUtils.getColorList(IFeature) * </code> * * @author Marcus Pinnecke * @since 2.7.5 */ @Deprecated public ColorList getColorList() { return FeatureUtils.getColorList(feature); } /** * <b>This class and all it's methods are deprecated and should <i>only</i> be used for compatibility reasons</b> * </br>Internally, the <code>de.ovgu.featureide.fm.core.Feature</code> class uses a delegiation to an underlying * {@link IFeature IFeature interface}.<br/><br/> * Instead of this method you should use<br/> * <code> * FeatureUtils.hashCode(IFeature) * </code> * * @author Marcus Pinnecke * @since 2.7.5 */ @Deprecated ======= >>>>>>> /** * <b>This class and all it's methods are deprecated and should <i>only</i> be used for compatibility reasons</b> * </br>Internally, the <code>de.ovgu.featureide.fm.core.Feature</code> class uses a delegiation to an underlying * {@link IFeature IFeature interface}.<br/><br/> * Instead of this method you should use<br/> * <code> * FeatureUtils.getColorList(IFeature) * </code> * * @author Marcus Pinnecke * @since 2.7.5 */ @Deprecated public ColorList getColorList() { return FeatureUtils.getColorList(feature); } /** * <b>This class and all it's methods are deprecated and should <i>only</i> be used for compatibility reasons</b> * </br>Internally, the <code>de.ovgu.featureide.fm.core.Feature</code> class uses a delegiation to an underlying * {@link IFeature IFeature interface}.<br/><br/> * Instead of this method you should use<br/> * <code> * FeatureUtils.hashCode(IFeature) * </code> * * @author Marcus Pinnecke * @since 2.7.5 */ @Deprecated
<<<<<<< * {@link IPropertyContainer#set(String, String, String)} earlier. Properties are stored persistently such that an assignment will be alive as long as it * was * not removed by calling {@link IPropertyContainer#remove(String, String)}. If no value was assigned (the <code>key is unknown</code>), a ======= * {@link IPropertyContainer#set(String, Type, Object)} earlier. Properties are stored persistently such that an assignment will be alive as long as it was * not removed by calling {@link IPropertyContainer#remove(String)}. If no value was assigned (the <code>key is unknown</code>), a >>>>>>> * {@link IPropertyContainer#set(String, String, String)} earlier. Properties are stored persistently such that an assignment will be alive as long as it * was not removed by calling {@link IPropertyContainer#remove(String, String)}. If no value was assigned (the <code>key is unknown</code>), a <<<<<<< * @param type type name (case insensitive) ======= >>>>>>> * @param type type name (case insensitive) <<<<<<< * {@link IPropertyContainer#set(String, String, String)} earlier. Properties are stored persistently such that an assignment will be alive as long as it * this method does not remove the property. If this object does not contain any property associated to <code>key</code>, a * <code>NoSuchPropertyException</code> will be thrown. ======= * {@link IPropertyContainer#set(String, Type, Object)} earlier. Properties are stored persistently such that an assignment will be alive as long as it this * method does not remove the property. If this object does not contain any property associated to <code>key</code>, a <code>NoSuchPropertyException</code> * will be thrown. >>>>>>> * {@link IPropertyContainer#set(String, String, String)} earlier. Properties are stored persistently such that an assignment will be alive as long as it * this method does not remove the property. If this object does not contain any property associated to <code>key</code>, a * <code>NoSuchPropertyException</code> * will be thrown. <<<<<<< * already set, the behavior of this method depends on the <code>KeyConflictPolicy</code>. <br/> <br/> Properties are stored persistently such that an * assignment will be alive as long as it was not removed by calling {@link IPropertyContainer#remove(String, String)}. <br/> <br/> To receive the value * behind a * <code>key</code>, call {@link IPropertyContainer#get(String, String)}. ======= * already set, the behavior of this method depends on the <code>KeyConflictPolicy</code>. <br> <br> Properties are stored persistently such that an * assignment will be alive as long as it was not removed by calling {@link IPropertyContainer#remove(String)}. <br> <br> To receive the value behind a * <code>key</code>, call {@link IPropertyContainer#get(String, Object)}. >>>>>>> * already set, the behavior of this method depends on the <code>KeyConflictPolicy</code>. <br> <br> Properties are stored persistently such that an * assignment will be alive as long as it was not removed by calling {@link IPropertyContainer#remove(String, String)}. <br> <br> To receive the value * behind a <code>key</code>, call {@link IPropertyContainer#get(String, String)}.
<<<<<<< import de.ovgu.featureide.fm.core.io.manager.FeatureModelManager; ======= import de.ovgu.featureide.fm.core.explanations.ExplanationWriter; import de.ovgu.featureide.fm.core.explanations.Reason; import de.ovgu.featureide.fm.core.explanations.fm.FeatureModelReason; >>>>>>> import de.ovgu.featureide.fm.core.explanations.ExplanationWriter; import de.ovgu.featureide.fm.core.explanations.Reason; import de.ovgu.featureide.fm.core.explanations.fm.FeatureModelReason; import de.ovgu.featureide.fm.core.io.manager.FeatureModelManager; <<<<<<< if (feature.getStructure().isRoot() && !analyser.isValid()) { setBackgroundColor(FMPropertyManager.getDeadFeatureBackgroundColor()); setBorder(FMPropertyManager.getDeadFeatureBorder(this.feature.isConstraintSelected())); toolTip.append(VOID); } else if (feature.getStructure().isConcrete()) { toolTip.append(CONCRETE); } else { setBackgroundColor(FMPropertyManager.getAbstractFeatureBackgroundColor()); toolTip.append(ABSTRACT); ======= //First draw custom color FeatureColor color = FeatureColorManager.getColor(feature); if (color != FeatureColor.NO_COLOR) { setBackgroundColor(new Color(null, ColorPalette.getRGB(color.getValue(), 0.5f))); } else if (!feature.getStructure().isConcrete()) { setBackgroundColor(FMPropertyManager.getAbstractFeatureBackgroundColor()); >>>>>>> if (feature.getStructure().isRoot() && !analyser.isValid()) { setBackgroundColor(FMPropertyManager.getDeadFeatureBackgroundColor()); setBorder(FMPropertyManager.getDeadFeatureBorder(this.feature.isConstraintSelected())); } else if (!feature.getStructure().isConcrete()) { setBackgroundColor(FMPropertyManager.getAbstractFeatureBackgroundColor()); <<<<<<< toolTip.append(feature.getStructure().isRoot() ? ROOT : FEATURE); final FeatureProperties featureProperties = FeatureUtils.getFeatureProperties(feature); if (featureProperties != null) { if (featureProperties.getFeatureSelectionStatus() == FeatureSelectionStatus.DEAD) { setBackgroundColor(FMPropertyManager.getDeadFeatureBackgroundColor()); setBorder(FMPropertyManager.getDeadFeatureBorder(this.feature.isConstraintSelected())); toolTip.append(DEAD); } else if (featureProperties.getFeatureParentStatus() == FeatureParentStatus.FALSE_OPTIONAL) { setBackgroundColor(FMPropertyManager.getWarningColor()); setBorder(FMPropertyManager.getConcreteFeatureBorder(this.feature.isConstraintSelected())); toolTip.append(FALSE_OPTIONAL); } else if (featureProperties.getFeatureDeterminedStatus() == FeatureDeterminedStatus.INDETERMINATE_HIDDEN) { setBackgroundColor(FMPropertyManager.getWarningColor()); setBorder(FMPropertyManager.getHiddenFeatureBorder(this.feature.isConstraintSelected())); toolTip.append(INDETERMINATE_HIDDEN); } ======= switch (feature.getProperty().getFeatureStatus()) { case DEAD: setBackgroundColor(FMPropertyManager.getDeadFeatureBackgroundColor()); setBorder(FMPropertyManager.getDeadFeatureBorder(this.feature.isConstraintSelected())); break; case FALSE_OPTIONAL: setBackgroundColor(FMPropertyManager.getWarningColor()); setBorder(FMPropertyManager.getConcreteFeatureBorder(this.feature.isConstraintSelected())); break; case INDETERMINATE_HIDDEN: setBackgroundColor(FMPropertyManager.getWarningColor()); setBorder(FMPropertyManager.getHiddenFeatureBorder(this.feature.isConstraintSelected())); break; default: break; >>>>>>> final FeatureProperties featureProperties = FeatureUtils.getFeatureProperties(feature); if (featureProperties != null) { if (featureProperties.getFeatureSelectionStatus() == FeatureSelectionStatus.DEAD) { setBackgroundColor(FMPropertyManager.getDeadFeatureBackgroundColor()); setBorder(FMPropertyManager.getDeadFeatureBorder(this.feature.isConstraintSelected())); } else if (featureProperties.getFeatureParentStatus() == FeatureParentStatus.FALSE_OPTIONAL) { setBackgroundColor(FMPropertyManager.getWarningColor()); setBorder(FMPropertyManager.getConcreteFeatureBorder(this.feature.isConstraintSelected())); } else if (featureProperties.getFeatureDeterminedStatus() == FeatureDeterminedStatus.INDETERMINATE_HIDDEN) { setBackgroundColor(FMPropertyManager.getWarningColor()); setBorder(FMPropertyManager.getHiddenFeatureBorder(this.feature.isConstraintSelected())); }
<<<<<<< final ConstraintProperties constraintProperties = FeatureUtils.getConstraintProperties(graphicalConstraint.getObject()); final StringBuilder toolTip = new StringBuilder(); ======= final IConstraint constraint = graphicalConstraint.getObject(); >>>>>>> final ConstraintProperties constraintProperties = FeatureUtils.getConstraintProperties(graphicalConstraint.getObject()); <<<<<<< if (!constraintProperties.getDeadFeatures().isEmpty()) { toolTip.append(DEAD_FEATURE); final List<String> deadFeatures = Functional.mapToList(constraintProperties.getDeadFeatures(), new Functional.ToStringFunction<IFeature>()); ======= case FALSE_OPTIONAL: if (!constraint.getDeadFeatures().isEmpty()) { final List<String> deadFeatures = new ArrayList<String>(constraint.getDeadFeatures().size()); for (final IFeature dead : constraint.getDeadFeatures()) { deadFeatures.add(dead.toString()); } >>>>>>> if (!constraintProperties.getDeadFeatures().isEmpty()) { final List<String> deadFeatures = Functional.mapToList(constraintProperties.getDeadFeatures(), new Functional.ToStringFunction<IFeature>()); <<<<<<< default: break; } switch (constraintProperties.getConstraintFalseOptionalStatus()) { case NORMAL: break; case FALSE_OPTIONAL: if (!constraintProperties.getFalseOptionalFeatures().isEmpty()) { final List<String> falseOptionalFeatures = Functional.mapToList(constraintProperties.getFalseOptionalFeatures(), new Functional.ToStringFunction<IFeature>()); ======= if (!constraint.getFalseOptional().isEmpty()) { final List<String> falseOptionalFeatures = new ArrayList<String>(constraint.getFalseOptional().size()); for (final IFeature feature : constraint.getFalseOptional()) { falseOptionalFeatures.add(feature.toString()); } >>>>>>> default: break; } switch (constraintProperties.getConstraintFalseOptionalStatus()) { case NORMAL: break; case FALSE_OPTIONAL: if (!constraintProperties.getFalseOptionalFeatures().isEmpty()) { final List<String> falseOptionalFeatures = Functional.mapToList(constraintProperties.getFalseOptionalFeatures(), new Functional.ToStringFunction<IFeature>());
<<<<<<< ======= import composer.rules.meta.FeatureModelInfo; >>>>>>> import composer.rules.meta.FeatureModelInfo; <<<<<<< ((FSTGenComposerExtension) composer).buildMetaProduct(getArguments(configPath, basePath, outputPath, CONTRACT_COMPOSITION_EXPLICIT_CONTRACTING), features); ======= String[] args = getArguments(configPath, basePath, outputPath, getContractParameter()); long start = System.currentTimeMillis(); FeatureModelInfo modelInfo = new FeatureIDEModelInfo(featureModel, !IFeatureProject.META_THEOREM_PROVING.equals(featureProject.getMetaProductGeneration())); ((FSTGenComposerExtension) composer).setModelInfo(modelInfo); ((FSTGenComposerExtension) composer).buildMetaProduct(args, features); long end = System.currentTimeMillis(); long duration = end-start; File file = new File("duration.txt"); try{ FileWriter writer = new FileWriter(file,true); writer.write(String.valueOf(duration)); writer.write(System.getProperty("line.separator")); writer.flush(); writer.close(); } catch (IOException ex){ } >>>>>>> String[] args = getArguments(configPath, basePath, outputPath, getContractParameter()); long start = System.currentTimeMillis(); FeatureModelInfo modelInfo = new FeatureIDEModelInfo(featureModel, !IFeatureProject.META_THEOREM_PROVING.equals(featureProject.getMetaProductGeneration())); ((FSTGenComposerExtension) composer).setModelInfo(modelInfo); ((FSTGenComposerExtension) composer).buildMetaProduct(args, features); long end = System.currentTimeMillis(); long duration = end-start; File file = new File("duration.txt"); try{ FileWriter writer = new FileWriter(file,true); writer.write(String.valueOf(duration)); writer.write(System.getProperty("line.separator")); writer.flush(); writer.close(); } catch (IOException ex){ } <<<<<<< /** * @param featureProject * @return */ ======= >>>>>>> <<<<<<< } else if (CONTRACT_COMPOSITION_PLAIN_CONTRACTING.equals(contractComposition)) { return CONTRACT_COMPOSITION_PLAIN_CONTRACTING; } else if (CONTRACT_COMPOSITION_CONTRACT_OVERRIDING.equals(contractComposition)) { ======= } else if (CONTRACT_COMPOSITION_PLAIN_CONTRACTING .equals(contractComposition)) { return CONTRACT_COMPOSITION_PLAIN_CONTRACT; } else if (CONTRACT_COMPOSITION_CONTRACT_OVERRIDING .equals(contractComposition)) { >>>>>>> } else if (CONTRACT_COMPOSITION_PLAIN_CONTRACTING .equals(contractComposition)) { return CONTRACT_COMPOSITION_PLAIN_CONTRACT; } else if (CONTRACT_COMPOSITION_CONTRACT_OVERRIDING .equals(contractComposition)) {
<<<<<<< case MASK: return MASK; ======= case INCLING: return INCLING; >>>>>>> case INCLING: return INCLING; <<<<<<< scaleTWise.setMaximum(CASA_MAX); } else if (selection.equals(MASK)) { scaleTWise.setMaximum(MASK_MAX); scaleTWise.setMinimum(MASK_MAX); scaleTWise.setSelection(MASK_MAX); scaleTWise.setEnabled(false); labelTWise.setText(LABEL_INTERACTIONS + "2"); ======= scale.setMaximum(CASA_MAX); } else if (selection.equals(INCLING)) { scale.setMaximum(MASK_MAX); scale.setMinimum(MASK_MAX); scale.setSelection(MASK_MAX); scale.setEnabled(false); labelT.setText(LABEL_INTERACTIONS + "2"); >>>>>>> scaleTWise.setMaximum(CASA_MAX); } else if (selection.equals(INCLING)) { scaleTWise.setMaximum(MASK_MAX); scaleTWise.setMinimum(MASK_MAX); scaleTWise.setSelection(MASK_MAX); scaleTWise.setEnabled(false); labelTWise.setText(LABEL_INTERACTIONS + "2");
<<<<<<< public static final int NUMBER_OF_LINES = 7; ======= private final FSTModel fstModel; private final int type; >>>>>>> public static final int NUMBER_OF_LINES = 7; private final FSTModel fstModel; private final int type;
<<<<<<< import java.util.Deque; import java.util.HashMap; ======= import java.util.Collections; >>>>>>> import java.util.Collections; import java.util.Deque; <<<<<<< /** The expression is satisfiable but not a tautology. */ static final int SAT_NONE = 0; /** The expression is a contradiction. */ static final int SAT_CONTRADICTION = 1; /** The expression is a tautology. */ static final int SAT_TAUTOLOGY = 2; protected static final String MESSAGE_DEAD_CODE = ": This expression is a contradiction and causes a dead code block."; protected static final String MESSAGE_ALWAYS_TRUE = ": This expression is a tautology and causes a superfluous code block."; protected static final String MESSAGE_ABSTRACT = IS_DEFINED_AS_ABSTRACT_IN_THE_FEATURE_MODEL__ONLY_CONCRETE_FEATURES_SHOULD_BE_REFERENCED_IN_PREPROCESSOR_DIRECTIVES_; ======= /** * The satisfiability status of an annotation. * * @author Christoph Giesel * @author Timo G&uuml;nther */ public enum AnnotationStatus { /** The presence condition is satisfiable but not a tautology. */ NORMAL, /** The presence condition is a contradiction, causing a dead code block. */ DEAD, /** The presence condition is a tautology, making the annotation superfluous. */ SUPERFLUOUS, /** The expression in and of itself is a contradiction, causing a dead code block. */ CONTRADICTION, /** The expression in and of itself is a tautology, making the annotation superfluous. */ TAUTOLOGY, } protected static final String MESSAGE_DEAD = "This annotation causes a dead code block."; protected static final String MESSAGE_SUPERFLUOUS = "This annotation is superfluous."; protected static final String MESSAGE_CONTRADICTION = "This expression is a contradiction and causes a dead code block."; protected static final String MESSAGE_TAUTOLOGY = "This expression is a tautology, making the annotation superfluous."; protected static final String MESSAGE_ABSTRACT = IS_DEFINED_AS_ABSTRACT_IN_THE_FEATURE_MODEL__ONLY_CONCRETE_FEATURES_SHOULD_BE_REFERENCED_IN_PREPROCESSOR_DIRECTIVES_; >>>>>>> /** * The satisfiability status of an annotation. * * @author Christoph Giesel * @author Timo G&uuml;nther */ public enum AnnotationStatus { /** The presence condition is satisfiable but not a tautology. */ NORMAL, /** The presence condition is a contradiction, causing a dead code block. */ DEAD, /** The presence condition is a tautology, making the annotation superfluous. */ SUPERFLUOUS, /** The expression in and of itself is a contradiction, causing a dead code block. */ CONTRADICTION, /** The expression in and of itself is a tautology, making the annotation superfluous. */ TAUTOLOGY, } protected static final String MESSAGE_DEAD = "This annotation causes a dead code block."; protected static final String MESSAGE_SUPERFLUOUS = "This annotation is superfluous."; protected static final String MESSAGE_CONTRADICTION = "This expression is a contradiction and causes a dead code block."; protected static final String MESSAGE_TAUTOLOGY = "This expression is a tautology, making the annotation superfluous."; protected static final String MESSAGE_ABSTRACT = IS_DEFINED_AS_ABSTRACT_IN_THE_FEATURE_MODEL__ONLY_CONCRETE_FEATURES_SHOULD_BE_REFERENCED_IN_PREPROCESSOR_DIRECTIVES_; <<<<<<< // TODO List<LocalExpression> list = map.get(ppExpression); if (list == null) { list = new ArrayList<>(); map.put(ppExpression, list); } list.add(new LocalExpression(lineNumber, res, expressionStack.toArray(new Node[0]))); /** collect all used features **/ findLiterals(ppExpression); int result = isContradictionOrTautology(ppExpression.clone(), false, lineNumber, res); if (result == SAT_NONE) { result = isContradictionOrTautology(ppExpression.clone(), true, lineNumber, res); if ((result == SAT_NONE) && !expressionStack.isEmpty()) { Node[] nestedExpressions = new Node[expressionStack.size()]; nestedExpressions = expressionStack.toArray(nestedExpressions); And nestedExpressionsAnd = new And(nestedExpressions); result = isContradictionOrTautology(nestedExpressionsAnd.clone(), true, lineNumber, res); if ((result == SAT_NONE) && (expressionStack.size() > 1)) { nestedExpressions = new Node[expressionStack.size() - 1]; int index = 0; for (final Node expression : expressionStack) { if (index == (expressionStack.size() - 1)) { break; } nestedExpressions[index++] = expression; } nestedExpressionsAnd = new And(nestedExpressions); checkRedundancy(ppExpression, nestedExpressionsAnd, lineNumber, res); } ======= boolean positive = false; switch (status) { case SUPERFLUOUS: positive = true; case DEAD: final InvariantPresenceConditionExplanation explanation = getInvariantExpressionExplanation(positive); if ((explanation != null) && (explanation.getReasons() != null) && !explanation.getReasons().isEmpty()) { message += System.lineSeparator(); message += explanation.getWriter().getString(); >>>>>>> boolean positive = false; switch (status) { case SUPERFLUOUS: positive = true; case DEAD: final InvariantPresenceConditionExplanation explanation = getInvariantExpressionExplanation(positive); if ((explanation != null) && (explanation.getReasons() != null) && !explanation.getReasons().isEmpty()) { message += System.lineSeparator(); message += explanation.getWriter().getString(); <<<<<<< if ((matcherFeature != null) && matcherFeature.matches()) { featureProject.createBuilderMarker(res, pluginName + ": " + name + MESSAGE_ABSTRACT, lineNumber, IMarker.SEVERITY_WARNING); ======= if ((matcherFeature != null) && matcherFeature.matches()) { featureProject.createBuilderMarker(res, name + MESSAGE_ABSTRACT, lineNumber, IMarker.SEVERITY_WARNING); >>>>>>> if ((matcherFeature != null) && matcherFeature.matches()) { featureProject.createBuilderMarker(res, name + MESSAGE_ABSTRACT, lineNumber, IMarker.SEVERITY_WARNING); <<<<<<< if ((matcherConreteFeature != null) && !matcherConreteFeature.matches()) { featureProject.createBuilderMarker(res, pluginName + ": " + name + MESSAGE_NOT_DEFINED, lineNumber, IMarker.SEVERITY_WARNING); ======= if ((matcherConreteFeature != null) && !matcherConreteFeature.matches()) { featureProject.createBuilderMarker(res, name + MESSAGE_NOT_DEFINED, lineNumber, IMarker.SEVERITY_WARNING); >>>>>>> if ((matcherConreteFeature != null) && !matcherConreteFeature.matches()) { featureProject.createBuilderMarker(res, name + MESSAGE_NOT_DEFINED, lineNumber, IMarker.SEVERITY_WARNING); <<<<<<< final String message = marker.getAttribute(IMarker.MESSAGE, ""); if (message.contains(MESSAGE_ABSTRACT) || message.contains(MESSAGE_ALWAYS_TRUE) || message.contains(MESSAGE_DEAD_CODE) || message.contains(MESSAGE_NOT_DEFINED)) { ======= final String message = marker.getAttribute(IMarker.MESSAGE, ""); if (message.contains(MESSAGE_ABSTRACT) || message.contains(MESSAGE_SUPERFLUOUS) || message.contains(MESSAGE_DEAD) || message.contains(MESSAGE_TAUTOLOGY) || message.contains(MESSAGE_CONTRADICTION) || message.contains(MESSAGE_NOT_DEFINED)) { >>>>>>> final String message = marker.getAttribute(IMarker.MESSAGE, ""); if (message.contains(MESSAGE_ABSTRACT) || message.contains(MESSAGE_SUPERFLUOUS) || message.contains(MESSAGE_DEAD) || message.contains(MESSAGE_TAUTOLOGY) || message.contains(MESSAGE_CONTRADICTION) || message.contains(MESSAGE_NOT_DEFINED)) {
<<<<<<< ======= int yoffset; int xoffset; >>>>>>> int yoffset; int xoffset; <<<<<<< ======= yoffset = FMPropertyManager.getLayoutMarginY(); xoffset = FMPropertyManager.getLayoutMarginX(); >>>>>>> yoffset = FMPropertyManager.getLayoutMarginY(); xoffset = FMPropertyManager.getLayoutMarginX(); <<<<<<< final LinkedList<IGraphicalFeature> list = new LinkedList<>(); list.add(root); while (!list.isEmpty()) { final IGraphicalFeature feature = list.removeFirst(); ======= for (final IGraphicalFeature feature : featureModel.getAllFeatures()) { >>>>>>> final LinkedList<IGraphicalFeature> list = new LinkedList<>(); list.add(root); while (!list.isEmpty()) { final IGraphicalFeature feature = list.removeFirst(); <<<<<<< setLocation(feature, new Point((int) (bounds.getX()), ((int) bounds.getY()))); list.addAll(getChildren(feature)); ======= setLocation(feature, new Point((int) (bounds.getX() + xoffset), ((int) bounds.getY() + yoffset))); >>>>>>> list.addAll(getChildren(feature)); setLocation(feature, new Point((int) (bounds.getX() + xoffset), ((int) bounds.getY() + yoffset))); <<<<<<< ======= // missing: to show how many features are hidden in parent feature // final Rectangle rootBounds = (Rectangle) treeLayout.getTree().getRoot().getObject(); // layoutConstraints(yoffset, featureModel.getVisibleConstraints(), rootBounds); >>>>>>>
<<<<<<< import de.ovgu.featureide.fm.core.base.impl.ExtendedFeature; import de.ovgu.featureide.fm.core.io.manager.IFeatureModelManager; import de.ovgu.featureide.fm.core.io.manager.IManager; ======= >>>>>>> import de.ovgu.featureide.fm.core.io.manager.IFeatureModelManager; import de.ovgu.featureide.fm.core.io.manager.IManager; <<<<<<< private final IFeatureModelManager fInput; ======= private IFeatureModel fInput; private IGraphicalFeatureModel graphicalFeatureModel; >>>>>>> private final IFeatureModelManager fInput; <<<<<<< public FmOutlinePageContextMenu(Object site, FeatureModelEditor fTextEditor, TreeViewer viewer, IFeatureModelManager fInput) { ======= public FmOutlinePageContextMenu(Object site, FeatureModelEditor fTextEditor, TreeViewer viewer, IGraphicalFeatureModel fInput) { >>>>>>> public FmOutlinePageContextMenu(Object site, FeatureModelEditor fTextEditor, TreeViewer viewer, IFeatureModelManager fInput) { <<<<<<< /** * @param syncCollapsedFeaturesToggle */ ======= public void setFeatureModel(IFeatureModel fm) { fInput = fm; } >>>>>>>
<<<<<<< import de.ovgu.featureide.fm.core.Feature; import de.ovgu.featureide.fm.core.FeatureModel; ======= import de.ovgu.featureide.core.signature.filter.IFilter; 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.base.FeatureUtils; import de.ovgu.featureide.fm.core.base.IFeature; import de.ovgu.featureide.fm.core.base.IFeatureModel;
<<<<<<< import de.ovgu.featureide.fm.core.io.manager.FileHandler; import de.ovgu.featureide.fm.core.io.manager.IFileManager; ======= >>>>>>> import de.ovgu.featureide.fm.core.io.manager.FileHandler; import de.ovgu.featureide.fm.core.io.manager.IFileManager; <<<<<<< IFileManager<IFeatureModel> fmManager; IFileManager<IGraphicalFeatureModel> gfmManager; ======= FeatureModelManager fmManager; >>>>>>> FeatureModelManager fmManager; IFileManager<IGraphicalFeatureModel> gfmManager; <<<<<<< public FeatureModelEditor() { super(); } public FeatureModelEditor(IFileManager<IFeatureModel> fmManager, IFileManager<IGraphicalFeatureModel> gfmManager) { super(); this.fmManager = fmManager; this.gfmManager = gfmManager; } ======= >>>>>>>
<<<<<<< import de.ovgu.featureide.fm.core.ColorschemeTable; import de.ovgu.featureide.fm.core.base.IFeatureModel; ======= import de.ovgu.featureide.fm.core.FeatureModel; import de.ovgu.featureide.fm.core.color.FeatureColorManager; >>>>>>> import de.ovgu.featureide.fm.core.base.IFeatureModel; import de.ovgu.featureide.fm.core.color.FeatureColorManager; <<<<<<< private IFeatureModel featureModel; public NewColorSchemeWizard(IFeatureModel featureModel) { ======= private FeatureModel featureModel; public NewColorSchemeWizard(FeatureModel featureModel, CollaborationView collaborationView) { >>>>>>> private IFeatureModel featureModel; public NewColorSchemeWizard(IFeatureModel featureModel, CollaborationView collaborationView) { <<<<<<< if (csName != null && !csName.isEmpty()) { ColorschemeTable colorschemeTable = featureModel.getGraphicRepresenation().getColorschemeTable(); colorschemeTable.addColorscheme(csName); ======= if (csName != null && !csName.isEmpty() && !FeatureColorManager.hasColorScheme(featureModel, csName)) { FeatureColorManager.newColorScheme(featureModel, csName); >>>>>>> if (csName != null && !csName.isEmpty() && !FeatureColorManager.hasColorScheme(featureModel, csName)) { FeatureColorManager.newColorScheme(featureModel, csName);
<<<<<<< newFeature.setAutomatic(oldFeature.getAutomatic()); ======= newFeature.cloneProperties(oldFeature); >>>>>>> newFeature.setAutomatic(oldFeature.getAutomatic()); newFeature.cloneProperties(oldFeature); <<<<<<< public boolean updateFeatures(FeatureModelFormula featureModel) { if ((featureModel != null) && (this.featureModel != featureModel)) { final IFeature featureRoot = FeatureUtils.getRoot(featureModel.getFeatureModel()); if (featureRoot != null) { this.featureModel = featureModel; propagator = null; root = initFeatures(null, featureRoot); selectableFeatures.clear(); readdFeatures(root); ======= for (final IFeatureStructure child : feature.getStructure().getChildren()) { final SelectableFeature sChild = FMFactoryManager.getFactory(featureModel).createSelectableFeature(child.getFeature()); sFeature.addChild(sChild); initFeatures(sChild, child.getFeature()); >>>>>>> public boolean updateFeatures(FeatureModelFormula featureModel) { if ((featureModel != null) && (this.featureModel != featureModel)) { final IFeature featureRoot = FeatureUtils.getRoot(featureModel.getFeatureModel()); if (featureRoot != null) { this.featureModel = featureModel; propagator = null; root = initFeatures(null, featureRoot); selectableFeatures.clear(); readdFeatures(root); <<<<<<< sFeature.removeChildren(); for (final IFeatureStructure child : feature.getStructure().getChildren()) { initFeatures(sFeature, child.getFeature()); } if (parent != null) { parent.addChild(sFeature); ======= final IFeature featureRoot = FeatureUtils.getRoot(featureModel); final SelectableFeature root = FMFactoryManager.getFactory(featureModel).createSelectableFeature(featureRoot); if (featureRoot != null) { initFeatures(root, featureRoot); } else { features.add(root); table.put(root.getName(), root); >>>>>>> sFeature.removeChildren(); for (final IFeatureStructure child : feature.getStructure().getChildren()) { initFeatures(sFeature, child.getFeature()); } if (parent != null) { parent.addChild(sFeature);
<<<<<<< ======= assertEquals(4, fileCount); List<DiskUsage> diskUsage = connector.tableOperations() .getDiskUsage(Collections.singleton(tableName)); assertEquals(1, diskUsage.size()); long usage = diskUsage.get(0).getUsage().longValue(); log.debug("usage {}", usage); assertTrue(usage > 700 && usage < 800); >>>>>>> <<<<<<< try (Scanner metaScanner = connector.createScanner(MetadataTable.NAME, Authorizations.EMPTY)) { metaScanner.fetchColumnFamily(MetadataSchema.TabletsSection.DataFileColumnFamily.NAME); metaScanner.setRange(new KeyExtent(tableId, null, null).toMetadataRange()); BatchWriter mbw = connector.createBatchWriter(MetadataTable.NAME, new BatchWriterConfig()); for (Entry<Key,Value> entry : metaScanner) { String cq = entry.getKey().getColumnQualifier().toString(); if (cq.startsWith(v1.toString())) { Path path = new Path(cq); String relPath = "/" + path.getParent().getName() + "/" + path.getName(); Mutation fileMut = new Mutation(entry.getKey().getRow()); fileMut.putDelete(entry.getKey().getColumnFamily(), entry.getKey().getColumnQualifier()); fileMut.put(entry.getKey().getColumnFamily().toString(), relPath, entry.getValue().toString()); mbw.addMutation(fileMut); } ======= Scanner metaScanner = connector.createScanner(MetadataTable.NAME, Authorizations.EMPTY); metaScanner.fetchColumnFamily(MetadataSchema.TabletsSection.DataFileColumnFamily.NAME); metaScanner.setRange(new KeyExtent(tableId, null, null).toMetadataRange()); BatchWriter mbw = connector.createBatchWriter(MetadataTable.NAME, new BatchWriterConfig()); for (Entry<Key,Value> entry : metaScanner) { String cq = entry.getKey().getColumnQualifier().toString(); if (cq.startsWith(v1.toString())) { Path path = new Path(cq); String relPath = "/" + path.getParent().getName() + "/" + path.getName(); Mutation fileMut = new Mutation(entry.getKey().getRow()); fileMut.putDelete(entry.getKey().getColumnFamily(), entry.getKey().getColumnQualifier()); fileMut.put(entry.getKey().getColumnFamily().toString(), relPath, entry.getValue().toString()); mbw.addMutation(fileMut); >>>>>>> try (Scanner metaScanner = connector.createScanner(MetadataTable.NAME, Authorizations.EMPTY)) { metaScanner.fetchColumnFamily(MetadataSchema.TabletsSection.DataFileColumnFamily.NAME); metaScanner.setRange(new KeyExtent(tableId, null, null).toMetadataRange()); BatchWriter mbw = connector.createBatchWriter(MetadataTable.NAME, new BatchWriterConfig()); for (Entry<Key,Value> entry : metaScanner) { String cq = entry.getKey().getColumnQualifier().toString(); if (cq.startsWith(v1.toString())) { Path path = new Path(cq); String relPath = "/" + path.getParent().getName() + "/" + path.getName(); Mutation fileMut = new Mutation(entry.getKey().getRow()); fileMut.putDelete(entry.getKey().getColumnFamily(), entry.getKey().getColumnQualifier()); fileMut.put(entry.getKey().getColumnFamily().toString(), relPath, entry.getValue().toString()); mbw.addMutation(fileMut); } <<<<<<< // keep retrying until WAL state information in ZooKeeper stabilizes or until test times out retry: while (true) { Instance i = conn.getInstance(); ZooReaderWriter zk = new ZooReaderWriter(i.getZooKeepers(), i.getZooKeepersSessionTimeOut(), ""); WalStateManager wals = new WalStateManager(i, zk); try { outer: for (Entry<Path,WalState> entry : wals.getAllState().entrySet()) { for (Path path : paths) { if (entry.getKey().toString().startsWith(path.toString())) { continue outer; } ======= // keep retrying until WAL state information in ZooKeeper stabilizes or until test times out retry: while (true) { Instance i = conn.getInstance(); ZooReaderWriter zk = new ZooReaderWriter(i.getZooKeepers(), i.getZooKeepersSessionTimeOut(), ""); WalStateManager wals = new WalStateManager(i, zk); try { outer: for (Entry<Path,WalState> entry : wals.getAllState().entrySet()) { for (Path path : paths) { if (entry.getKey().toString().startsWith(path.toString())) { continue outer; >>>>>>> // keep retrying until WAL state information in ZooKeeper stabilizes or until test times out retry: while (true) { Instance i = conn.getInstance(); ZooReaderWriter zk = new ZooReaderWriter(i.getZooKeepers(), i.getZooKeepersSessionTimeOut(), ""); WalStateManager wals = new WalStateManager(i, zk); try { outer: for (Entry<Path,WalState> entry : wals.getAllState().entrySet()) { for (Path path : paths) { if (entry.getKey().toString().startsWith(path.toString())) { continue outer; } <<<<<<< ======= break; } // if a volume is chosen randomly for each tablet, then the probability that a volume will not // be chosen for any tablet is ((num_volumes - // 1)/num_volumes)^num_tablets. For 100 tablets and 3 volumes the probability that only 2 // volumes would be chosen is 2.46e-18 >>>>>>> <<<<<<< String zpath = ZooUtil.getRoot(getConnector().getInstance()) + RootTable.ZROOT_TABLET_PATH; ======= String zpath = ZooUtil.getRoot(new ZooKeeperInstance(cluster.getClientConfig())) + RootTable.ZROOT_TABLET_PATH; >>>>>>> String zpath = ZooUtil.getRoot(getConnector().getInstance()) + RootTable.ZROOT_TABLET_PATH; <<<<<<< conn.tableOperations().clone(tableNames[0], tableNames[1], true, new HashMap<>(), new HashSet<>()); ======= conn.tableOperations().clone(tableNames[0], tableNames[1], true, new HashMap<String,String>(), new HashSet<String>()); >>>>>>> conn.tableOperations().clone(tableNames[0], tableNames[1], true, new HashMap<>(), new HashSet<>()); <<<<<<< String zpath = ZooUtil.getRoot(getConnector().getInstance()) + RootTable.ZROOT_TABLET_PATH; ======= String zpath = ZooUtil.getRoot(new ZooKeeperInstance(cluster.getClientConfig())) + RootTable.ZROOT_TABLET_PATH; >>>>>>> String zpath = ZooUtil.getRoot(getConnector().getInstance()) + RootTable.ZROOT_TABLET_PATH; <<<<<<< getConnector().tableOperations().clone(tableNames[1], tableNames[2], true, new HashMap<>(), new HashSet<>()); ======= getConnector().tableOperations().clone(tableNames[1], tableNames[2], true, new HashMap<String,String>(), new HashSet<String>()); >>>>>>> getConnector().tableOperations().clone(tableNames[1], tableNames[2], true, new HashMap<>(), new HashSet<>());
<<<<<<< ======= import org.eclipse.draw2d.IFigure; import org.eclipse.draw2d.geometry.Point; >>>>>>> <<<<<<< ======= import org.eclipse.gef.editparts.AbstractEditPart; import org.eclipse.gef.editparts.AbstractGraphicalEditPart; >>>>>>> <<<<<<< getModel().registerUIObject(this); getFigure().setVisible(true); ======= getFeature().registerUIObject(this); >>>>>>> getModel().registerUIObject(this); <<<<<<< for (FeatureConnection connection : getModel().getTargetConnections()) { ======= getFeatureFigure().setLocation(getFeature().getLocation()); for (FeatureConnection connection : getFeature().getTargetConnections()) { >>>>>>> getFigure().setLocation(getModel().getLocation()); for (FeatureConnection connection : getModel().getTargetConnections()) { <<<<<<< String displayName = getModel().getObject().getProperty().getDisplayName(); if(getModel().getGraphicalModel().getLayout().showShortNames()){ ======= String displayName = getFeature().getObject().getName(); if (getFeature().getGraphicalModel().getLayout().showShortNames()) { >>>>>>> String displayName = getModel().getObject().getName(); if (getModel().getGraphicalModel().getLayout().showShortNames() ){ <<<<<<< } getFigure().setName(displayName); getModel().setSize(getFigure().getSize()); ======= } getFeatureFigure().setName(displayName); getFeature().setSize(getFeatureFigure().getSize()); refreshCollapsedDecorator(); >>>>>>> } getFigure().setName(displayName); getModel().setSize(getFigure().getSize()); refreshCollapsedDecorator(); <<<<<<< getFigure().setProperties(); ======= case COLLAPSED_ALL_CHANGED: case COLLAPSED_CHANGED: getFeatureFigure().setProperties(); >>>>>>> case COLLAPSED_ALL_CHANGED: case COLLAPSED_CHANGED: getFigure().setProperties();
<<<<<<< import de.ovgu.featureide.fm.core.io.FileSystem; import de.ovgu.featureide.fm.core.io.IPersistentFormat; ======= import de.ovgu.featureide.fm.core.io.guidsl.GuidslFormat; >>>>>>> import de.ovgu.featureide.fm.core.io.FileSystem; import de.ovgu.featureide.fm.core.io.IPersistentFormat; import de.ovgu.featureide.fm.core.io.guidsl.GuidslFormat; <<<<<<< import de.ovgu.featureide.fm.core.io.manager.FileHandler; import de.ovgu.featureide.fm.ui.editors.IGraphicalFeatureModel; import de.ovgu.featureide.fm.ui.editors.elements.TikzFormat; ======= import de.ovgu.featureide.fm.core.io.manager.SimpleFileHandler; import de.ovgu.featureide.fm.core.io.velvet.VelvetFeatureModelFormat; import de.ovgu.featureide.fm.core.io.xml.XmlFeatureModelFormat; >>>>>>> import de.ovgu.featureide.fm.core.io.manager.FileHandler; import de.ovgu.featureide.fm.core.io.manager.SimpleFileHandler; import de.ovgu.featureide.fm.core.io.velvet.VelvetFeatureModelFormat; import de.ovgu.featureide.fm.core.io.xml.XmlFeatureModelFormat; import de.ovgu.featureide.fm.ui.editors.IGraphicalFeatureModel; import de.ovgu.featureide.fm.ui.editors.elements.TikzFormat;
<<<<<<< import de.ovgu.featureide.fm.core.FunctionalInterfaces; import de.ovgu.featureide.fm.core.FunctionalInterfaces.IBinaryFunction; import de.ovgu.featureide.fm.core.FunctionalInterfaces.IConsumer; import de.ovgu.featureide.fm.core.FunctionalInterfaces.IFunction; ======= import de.ovgu.featureide.fm.core.base.FeatureUtils; import de.ovgu.featureide.fm.core.base.IFeature; import de.ovgu.featureide.fm.core.base.event.FeatureIDEEvent; >>>>>>> import de.ovgu.featureide.fm.core.base.FeatureUtils; import de.ovgu.featureide.fm.core.base.IFeature; import de.ovgu.featureide.fm.core.base.event.FeatureIDEEvent; <<<<<<< import de.ovgu.featureide.fm.core.configuration.IConfiguration; ======= import de.ovgu.featureide.fm.core.configuration.Configuration; import de.ovgu.featureide.fm.core.configuration.ConfigurationMatrix; import de.ovgu.featureide.fm.core.configuration.ConfigurationPropagatorJobWrapper.IConfigJob; >>>>>>> import de.ovgu.featureide.fm.core.configuration.Configuration; import de.ovgu.featureide.fm.core.configuration.ConfigurationMatrix; <<<<<<< // private final HashSet<SelectableFeature> invalidFeatures = new HashSet<SelectableFeature>(); ======= private static final Image IMAGE_EXPAND = FMUIPlugin.getDefault().getImageDescriptor("icons/expand.gif").createImage(); private static final Image IMAGE_COLLAPSE = FMUIPlugin.getDefault().getImageDescriptor("icons/collapse.gif").createImage(); private static final Image IMAGE_AUTOEXPAND_GROUP = FMUIPlugin.getDefault().getImageDescriptor("icons/tree02.png").createImage(); private static final Image IMAGE_NEXT = FMUIPlugin.getDefault().getImageDescriptor("icons/arrow_down.png").createImage(); private static final Image IMAGE_PREVIOUS = FMUIPlugin.getDefault().getImageDescriptor("icons/arrow_up.png").createImage(); private final HashSet<SelectableFeature> invalidFeatures = new HashSet<SelectableFeature>(); >>>>>>> private static final Image IMAGE_EXPAND = FMUIPlugin.getDefault().getImageDescriptor("icons/expand.gif").createImage(); private static final Image IMAGE_COLLAPSE = FMUIPlugin.getDefault().getImageDescriptor("icons/collapse.gif").createImage(); private static final Image IMAGE_AUTOEXPAND_GROUP = FMUIPlugin.getDefault().getImageDescriptor("icons/tree02.png").createImage(); private static final Image IMAGE_NEXT = FMUIPlugin.getDefault().getImageDescriptor("icons/arrow_down.png").createImage(); private static final Image IMAGE_PREVIOUS = FMUIPlugin.getDefault().getImageDescriptor("icons/arrow_up.png").createImage(); private final HashSet<SelectableFeature> invalidFeatures = new HashSet<SelectableFeature>(); <<<<<<< // if (configurationEditor.getConfiguration().canBeValid()) { // invalidFeatures.clear(); // } else { // invalidFeatures.add(feature); // } // updateInfoLabel(); ======= if (configurationEditor.getConfiguration().canBeValid()) { invalidFeatures.clear(); } else { invalidFeatures.add(feature); } >>>>>>> if (configurationEditor.getConfiguration().canBeValid()) { invalidFeatures.clear(); } else { invalidFeatures.add(feature); } <<<<<<< if (errorMessage(tree)) { final IConfiguration configuration = configurationEditor.getConfiguration(); ======= if (errorMessage()) { final Configuration configuration = configurationEditor.getConfiguration(); >>>>>>> if (errorMessage()) { final Configuration configuration = configurationEditor.getConfiguration();
<<<<<<< import de.ovgu.featureide.fm.core.FunctionalInterfaces.IFunction; ======= import de.ovgu.featureide.fm.core.StoppableJob; >>>>>>> import de.ovgu.featureide.fm.core.FunctionalInterfaces.IFunction; <<<<<<< protected final WorkMonitor workMonitor = new WorkMonitor(); private int status = STATUS_NOTSTARTED; private LinkedList<JobFinishListener> jobFinishedListeners = new LinkedList<JobFinishListener>(); ======= private JobStatus status = JobStatus.NOT_STARTED; private LinkedList<JobFinishListener> jobFinishedListeners = new LinkedList<JobFinishListener>(); >>>>>>> protected final WorkMonitor workMonitor = new WorkMonitor(); private JobStatus status = JobStatus.NOT_STARTED; private LinkedList<JobFinishListener> jobFinishedListeners = new LinkedList<JobFinishListener>();
<<<<<<< import static de.ovgu.featureide.fm.core.localization.StringTable.CONSTRAINTS; import static de.ovgu.featureide.fm.core.localization.StringTable.CREATE_FEATURE_BELOW; import static de.ovgu.featureide.fm.core.localization.StringTable.CREATE_SIBLING; import static de.ovgu.featureide.fm.core.localization.StringTable.DELETE; ======= >>>>>>> <<<<<<< manager.add(cAction); csAction.setText(CREATE_SIBLING); manager.add(csAction); clAction.setText(CREATE_FEATURE_BELOW); manager.add(clAction); dAction.setText(DELETE); manager.add(dAction); manager.add(dAAction); manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS)); if (oAction.isEnabled() || altAction.isEnabled() || andAction.isEnabled()) { manager.add(andAction); manager.add(oAction); manager.add(altAction); manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS)); } manager.add(mAction); manager.add(aAction); manager.add(hAction); manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS)); // TODO _interfaces Removed Code ======= >>>>>>>
<<<<<<< import de.ovgu.featureide.fm.core.editing.AdvancedNodeCreator; ======= 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.base.IFeature; import de.ovgu.featureide.fm.core.base.IFeatureModel; import de.ovgu.featureide.fm.core.editing.AdvancedNodeCreator; <<<<<<< private Node createRootNode(FeatureModel fm) { return AdvancedNodeCreator.createCNF(fm); ======= private Node createRootNode(IFeatureModel fm) { return NodeCreator.createNodes(fm, true).toCNF(); >>>>>>> private Node createRootNode(IFeatureModel fm) { return AdvancedNodeCreator.createCNF(fm);
<<<<<<< /** * Returns an instance of {@link AutomaticSelectionExplanationCreator}. * * @param config the configuration * @return an instance of {@link AutomaticSelectionExplanationCreator} */ public abstract AutomaticSelectionExplanationCreator getAutomaticSelectionExplanationCreator(Configuration config); ======= >>>>>>>
<<<<<<< import de.ovgu.featureide.fm.core.analysis.cnf.IVariables; import de.ovgu.featureide.fm.core.analysis.cnf.LiteralSet; ======= import org.prop4j.Node; import de.ovgu.featureide.fm.core.Logger; >>>>>>> import de.ovgu.featureide.fm.core.Logger; import de.ovgu.featureide.fm.core.analysis.cnf.IVariables; import de.ovgu.featureide.fm.core.analysis.cnf.LiteralSet; <<<<<<< public IVariables getVariables() { return variables; } public void setVariables(IVariables variables) { this.variables = variables; } ======= @Override public SelectableFeature clone() { if (!this.getClass().equals(SelectableFeature.class)) { try { return (SelectableFeature) super.clone(); } catch (final CloneNotSupportedException e) { Logger.logError(e); throw new RuntimeException("Cloning is not supported for " + this.getClass()); } } return new SelectableFeature(this); } >>>>>>> public IVariables getVariables() { return variables; } public void setVariables(IVariables variables) { this.variables = variables; } @Override public SelectableFeature clone() { if (!this.getClass().equals(SelectableFeature.class)) { try { return (SelectableFeature) super.clone(); } catch (final CloneNotSupportedException e) { Logger.logError(e); throw new RuntimeException("Cloning is not supported for " + this.getClass()); } } return new SelectableFeature(this); }
<<<<<<< // ConfigFormatManager.setExtensionLoader(new CoreExtensionLoader<>(new DefaultFormat(), new FeatureIDEFormat(), new EquationFormat(), new // ExpressionFormat())); // FMFormatManager.setExtensionLoader(new CoreExtensionLoader<>(new XmlFeatureModelFormat(), new SimpleVelvetFeatureModelFormat(), new DIMACSFormat(), // new SXFMFormat(), new GuidslFormat())); // FMFactoryManager.setExtensionLoader(new CoreExtensionLoader<>(new DefaultFeatureModelFactory(), new ExtendedFeatureModelFactory())); Logger.logger = new EclipseLogger(); FMFactoryManager.factoryWorkspaceProvider = new EclipseFactoryWorkspaceProvider(); if (!FMFactoryManager.factoryWorkspaceProvider.load()) { FMFactoryManager.factoryWorkspaceProvider.getFactoryWorkspace().assignID(VelvetFeatureModelFormat.ID, ExtendedFeatureModelFactory.ID); } ======= >>>>>>> <<<<<<< ======= public void analyzeModel(IFile file) { logInfo(READING_MODEL_FILE___); final IContainer outputDir = file.getParent(); if ((outputDir == null) || !(outputDir instanceof IFolder)) { return; } final Path path = file.getLocation().toFile().toPath(); final FeatureModelManager instance = FeatureModelManager.getInstance(path, false); if (instance != null) { final IFeatureModel fm = instance.getObject(); try { final FeatureModelAnalyzer fma = new FeatureModelAnalyzer(fm); fma.analyzeFeatureModel(null); final StringBuilder sb = new StringBuilder(); sb.append("Number Features: "); sb.append(fm.getNumberOfFeatures()); sb.append(" ("); sb.append(fma.countConcreteFeatures()); sb.append(")\n"); if (fm instanceof ExtendedFeatureModel) { final ExtendedFeatureModel extFeatureModel = (ExtendedFeatureModel) fm; int countInherited = 0; int countInstances = 0; for (final UsedModel usedModel : extFeatureModel.getExternalModels().values()) { switch (usedModel.getType()) { case ExtendedFeature.TYPE_INHERITED: countInherited++; break; case ExtendedFeature.TYPE_INSTANCE: countInstances++; break; } } sb.append("Number Instances: "); sb.append(countInstances); sb.append("\n"); sb.append("Number Inherited: "); sb.append(countInherited); sb.append("\n"); } final List<List<IFeature>> unnomralFeature = fma.analyzeFeatures(); Collection<IFeature> analyzedFeatures = unnomralFeature.get(0); sb.append("Core Features ("); sb.append(analyzedFeatures.size()); sb.append("): "); for (final IFeature coreFeature : analyzedFeatures) { sb.append(coreFeature.getName()); sb.append(", "); } analyzedFeatures = unnomralFeature.get(1); sb.append("\nDead Features ("); sb.append(analyzedFeatures.size()); sb.append("): "); for (final IFeature deadFeature : analyzedFeatures) { sb.append(deadFeature.getName()); sb.append(", "); } analyzedFeatures = fma.getFalseOptionalFeatures(); sb.append("\nFO Features ("); sb.append(analyzedFeatures.size()); sb.append("): "); for (final IFeature foFeature : analyzedFeatures) { sb.append(foFeature.getName()); sb.append(", "); } sb.append("\n"); final IFile outputFile = ((IFolder) outputDir).getFile(file.getName() + "_output.txt"); final InputStream inputStream = new ByteArrayInputStream(sb.toString().getBytes(Charset.defaultCharset())); if (outputFile.isAccessible()) { outputFile.setContents(inputStream, false, true, null); } else { outputFile.create(inputStream, true, null); } logInfo(PRINTED_OUTPUT_FILE_); } catch (final Exception e) { logError(e); } } } >>>>>>>
<<<<<<< ======= private static final QualifiedName configFolderConfigID = new QualifiedName("featureproject.configs", "equations"); private static final String CONFIGS_ARGUMENT = "equations"; private static final String DEFAULT_CONFIGS_PATH = "equations"; private static final String BUILDER_ID = "de.ovgu.featureide.core" + ".extensibleFeatureProjectBuilder"; >>>>>>> <<<<<<< private org.eclipse.swt.widgets.List featurelist; ======= private FeatureOrderTable featureOrderTable; >>>>>>> private FeatureOrderTable featureOrderTable; <<<<<<< ======= public Composite comp; private GridData gridData; >>>>>>> <<<<<<< ======= public void setDirty() { dirty = true; firePropertyChange(PROP_DIRTY); } >>>>>>> <<<<<<< private List<String> getSelectedItems() { final int[] focuses = featurelist.getSelectionIndices(); ======= private LinkedList<String> getSelectedItems() { final int[] focuses = featureOrderTable.getSelectionsIndices(); >>>>>>> private List<String> getSelectedItems() { final int[] focuses = featureOrderTable.getSelectionsIndices(); <<<<<<< setDirty(true); ======= setDirty(); >>>>>>> setDirty(true); <<<<<<< if (getFeatureModel().getStructure().getRoot() != null) { getFeatureModel().setFeatureOrderList(Collections.<String> emptyList()); for (final String featureName : getFeatureModel().getFeatureOrderList()) { featurelist.add(featureName); ======= if (featureModelEditor.getFeatureModel().getStructure().getRoot() != null) { featureModelEditor.getFeatureModel().setFeatureOrderList(Collections.<String> emptyList()); for (final String featureName : featureModelEditor.getFeatureModel().getFeatureOrderList()) { featureOrderTable.addItem(featureName); >>>>>>> if (getFeatureModel().getStructure().getRoot() != null) { getFeatureModel().setFeatureOrderList(Collections.<String> emptyList()); for (final String featureName : getFeatureModel().getFeatureOrderList()) { featureOrderTable.addItem(featureName); <<<<<<< if (featureSet.remove(getFeatureModel().getRenamingsManager().getNewName(featurelist.getItem(i)))) { featurelist.setItem(i, getFeatureModel().getRenamingsManager().getNewName(featurelist.getItem(i))); ======= if (featureSet.remove(featureModelEditor.getFeatureModel().getRenamingsManager().getNewName(featureOrderTable.getItem(i)))) { featureOrderTable.setItem(featureModelEditor.getFeatureModel().getRenamingsManager().getNewName(featureOrderTable.getItem(i)), i); >>>>>>> if (featureSet.remove(getFeatureModel().getRenamingsManager().getNewName(featureOrderTable.getItem(i)))) { featureOrderTable.setItem(getFeatureModel().getRenamingsManager().getNewName(featureOrderTable.getItem(i)), i); <<<<<<< final IFile inputFile = Adapters.adapt(input, IFile.class); if (inputFile != null) { final IFile orderFile = inputFile.getProject().getFile(".order"); if (orderFile.isAccessible()) { FileHandler.save(Paths.get(orderFile.getLocationURI()), getFeatureModel(), new FeatureOrderFormat()); ======= // Cast is necessary, don't remove File file = ((IFile) input.getAdapter(IFile.class)).getProject().getLocation().toFile(); final String fileSep = System.getProperty("file.separator"); file = new File(file.toString() + fileSep + ".order"); if (!file.exists()) { return; } final String newLine = System.getProperty("line.separator"); FileWriter fw = null; try { fw = new FileWriter(file.toString()); fw.write(((featureModelEditor.getFeatureModel().isFeatureOrderUserDefined()) ? "true" : "false") + newLine); Collection<String> list = featureModelEditor.getFeatureModel().getFeatureOrderList(); if (list.isEmpty()) { list = FeatureUtils.extractConcreteFeaturesAsStringList(featureModelEditor.getFeatureModel()); // set default values } for (final String featureName : list) { fw.write(featureName); fw.append(newLine); } } catch (final IOException e) { FMUIPlugin.getDefault().logError(e); } finally { if (fw != null) { try { fw.close(); } catch (final IOException e) { FMUIPlugin.getDefault().logError(e); } >>>>>>> final IFile inputFile = ((IFile) input.getAdapter(IFile.class)); if (inputFile != null) { final IFile orderFile = inputFile.getProject().getFile(".order"); if (orderFile.isAccessible()) { FileHandler.save(Paths.get(orderFile.getLocationURI()), getFeatureModel(), new FeatureOrderFormat());
<<<<<<< import java.util.HashSet; ======= import java.util.Iterator; >>>>>>> import java.util.HashSet; <<<<<<< ======= >>>>>>> <<<<<<< case ACTIVE_EXPLANATION_CHANGED: //Deactivate the old active explanation. final Explanation oldActiveExplanation = (Explanation) event.getOldValue(); if (oldActiveExplanation != null) { final IGraphicalElement defectElement = FeatureUIHelper.getGraphicalElement(oldActiveExplanation.getDefectElement(), getGraphicalFeatureModel()); defectElement.update(event); } //Activate the new active explanation. final Explanation newActiveExplanation = (Explanation) event.getNewValue(); if (newActiveExplanation != null) { final IGraphicalElement defectElement = FeatureUIHelper.getGraphicalElement(newActiveExplanation.getDefectElement(), getGraphicalFeatureModel()); defectElement.update(event); } //Notify each affected element of its new active reason. final Map<IGraphicalElement, Explanation.Reason> elementOldActiveReasons = getGraphicalElementReasons(oldActiveExplanation); final Map<IGraphicalElement, Explanation.Reason> elementNewActiveReasons = getGraphicalElementReasons(newActiveExplanation); final Set<IGraphicalElement> elements = new HashSet<>(); elements.addAll(elementOldActiveReasons.keySet()); elements.addAll(elementNewActiveReasons.keySet()); for (final IGraphicalElement element : elements) { element.update(new FeatureIDEEvent( event.getSource(), EventType.ACTIVE_REASON_CHANGED, elementOldActiveReasons.get(element), elementNewActiveReasons.get(element))); } break; ======= case DEFAULT: break; >>>>>>> case ACTIVE_EXPLANATION_CHANGED: //Deactivate the old active explanation. final Explanation oldActiveExplanation = (Explanation) event.getOldValue(); if (oldActiveExplanation != null) { final IGraphicalElement defectElement = FeatureUIHelper.getGraphicalElement(oldActiveExplanation.getDefectElement(), getGraphicalFeatureModel()); defectElement.update(event); } //Activate the new active explanation. final Explanation newActiveExplanation = (Explanation) event.getNewValue(); if (newActiveExplanation != null) { final IGraphicalElement defectElement = FeatureUIHelper.getGraphicalElement(newActiveExplanation.getDefectElement(), getGraphicalFeatureModel()); defectElement.update(event); } //Notify each affected element of its new active reason. final Map<IGraphicalElement, Explanation.Reason> elementOldActiveReasons = getGraphicalElementReasons(oldActiveExplanation); final Map<IGraphicalElement, Explanation.Reason> elementNewActiveReasons = getGraphicalElementReasons(newActiveExplanation); final Set<IGraphicalElement> elements = new HashSet<>(); elements.addAll(elementOldActiveReasons.keySet()); elements.addAll(elementNewActiveReasons.keySet()); for (final IGraphicalElement element : elements) { element.update(new FeatureIDEEvent( event.getSource(), EventType.ACTIVE_REASON_CHANGED, elementOldActiveReasons.get(element), elementNewActiveReasons.get(element))); } break; case DEFAULT: break; <<<<<<< /** * Returns each reason mapped to the graphical feature model element it affects. * @param explanation explanation containing reasons * @return each reason mapped to the graphical feature model element it affects; never null */ private Map<IGraphicalElement, Explanation.Reason> getGraphicalElementReasons(Explanation explanation) { if (explanation == null) { return Collections.emptyMap(); } final Map<IGraphicalElement, Explanation.Reason> elementReasons = new HashMap<>(); for (final Explanation.Reason reason : explanation.getReasons()) { elementReasons.put(FeatureUIHelper.getGraphicalElement(reason.getSourceElement(), getGraphicalFeatureModel()), reason); } return elementReasons; } ======= /** * Scrolls to the given points and center the view * * @param centerFeature */ public void centerPointOnScreen(IFeature feature) { IGraphicalFeature graphFeature = graphicalFeatureModel.getGraphicalFeature(feature); final Map<?, ?> registryCollapsed = getEditPartRegistry(); final Object featureEditPart = registryCollapsed.get(graphFeature); if (featureEditPart instanceof FeatureEditPart) { FeatureEditPart editPart = (FeatureEditPart) featureEditPart; int x = editPart.getFigure().getBounds().x; int y = editPart.getFigure().getBounds().y; int offsetX = editPart.getFigure().getBounds().width / 2; int offsetY = editPart.getFigure().getBounds().height / 2; int xCenter = (int) (zoomManager.getZoom() * x - (getFigureCanvas().getViewport().getSize().width / 2) + (zoomManager.getZoom() * offsetX)); int yCenter = (int) (zoomManager.getZoom() * y - (getFigureCanvas().getViewport().getSize().height / 2) + (zoomManager.getZoom() * offsetY)); getFigureCanvas().getViewport().setViewLocation(xCenter, yCenter); } } >>>>>>> /** * Returns each reason mapped to the graphical feature model element it affects. * @param explanation explanation containing reasons * @return each reason mapped to the graphical feature model element it affects; never null */ private Map<IGraphicalElement, Explanation.Reason> getGraphicalElementReasons(Explanation explanation) { if (explanation == null) { return Collections.emptyMap(); } final Map<IGraphicalElement, Explanation.Reason> elementReasons = new HashMap<>(); for (final Explanation.Reason reason : explanation.getReasons()) { elementReasons.put(FeatureUIHelper.getGraphicalElement(reason.getSourceElement(), getGraphicalFeatureModel()), reason); } return elementReasons; } /** * Scrolls to the given points and center the view * * @param centerFeature */ public void centerPointOnScreen(IFeature feature) { IGraphicalFeature graphFeature = graphicalFeatureModel.getGraphicalFeature(feature); final Map<?, ?> registryCollapsed = getEditPartRegistry(); final Object featureEditPart = registryCollapsed.get(graphFeature); if (featureEditPart instanceof FeatureEditPart) { FeatureEditPart editPart = (FeatureEditPart) featureEditPart; int x = editPart.getFigure().getBounds().x; int y = editPart.getFigure().getBounds().y; int offsetX = editPart.getFigure().getBounds().width / 2; int offsetY = editPart.getFigure().getBounds().height / 2; int xCenter = (int) (zoomManager.getZoom() * x - (getFigureCanvas().getViewport().getSize().width / 2) + (zoomManager.getZoom() * offsetX)); int yCenter = (int) (zoomManager.getZoom() * y - (getFigureCanvas().getViewport().getSize().height / 2) + (zoomManager.getZoom() * offsetY)); getFigureCanvas().getViewport().setViewLocation(xCenter, yCenter); } }
<<<<<<< import de.ovgu.featureide.fm.core.base.event.PropertyConstants; import de.ovgu.featureide.fm.core.conf.IFeatureGraph; ======= >>>>>>>
<<<<<<< import java.util.Collections; import java.util.HashSet; ======= import java.util.HashMap; >>>>>>> import java.util.HashMap; <<<<<<< import de.ovgu.featureide.fm.core.conf.IFeatureGraph; ======= 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.base.event.PropertyConstants; 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.base.event.PropertyConstants; import de.ovgu.featureide.fm.core.conf.IFeatureGraph; import de.ovgu.featureide.fm.core.functional.Functional; <<<<<<< public class FeatureModel extends DeprecatedFeatureModel implements PropertyConstants, IGraphicItem { private Feature rootFeature; /** * A {@link Map} containing all features. */ private final Map<String, Feature> featureTable = new ConcurrentHashMap<String, Feature>(); protected final List<Constraint> constraints = new LinkedList<Constraint>(); private final List<PropertyChangeListener> listenerList = new LinkedList<PropertyChangeListener>(); private final FeatureModelAnalyzer analyser = createAnalyser(); private final RenamingsManager renamingsManager = new RenamingsManager(this); /** * All comment lines from the model file without line number at which they * occur */ private final List<String> comments; /** * Saves the annotations from the model file as they were read, * because they were not yet used. */ private final List<String> annotations; /** * A list containing the feature names in their specified order will be * initialized in XmlFeatureModelReader. */ private final List<String> featureOrderList; private final FeatureModelLayout layout; private boolean featureOrderUserDefined; private boolean featureOrderInXML; private Object undoContext; private FMComposerManager fmComposerManager; ======= public class FeatureModel extends DeprecatedFeatureModel implements PropertyConstants, IGraphicItem, Cloneable { public IFeatureModel model; >>>>>>> public class FeatureModel extends DeprecatedFeatureModel implements PropertyConstants, IGraphicItem, Cloneable { public IFeatureModel model; <<<<<<< this.featureOrderList = new LinkedList<String>(); this.featureOrderUserDefined = false; this.featureOrderInXML = false; this.comments = new LinkedList<>(); this.annotations = new LinkedList<>(); this.layout = new FeatureModelLayout(); ======= public FeatureModel(IFeatureModel model) { this.model = model; >>>>>>> public FeatureModel(IFeatureModel model) { this.model = model; <<<<<<< this(oldFeatureModel, null, complete); } public FeatureModel(FeatureModel oldFeatureModel, Feature newRoot, boolean complete) { super(); if (newRoot == null) { this.featureOrderList = new LinkedList<String>(oldFeatureModel.featureOrderList); if (oldFeatureModel.rootFeature != null) { this.rootFeature = oldFeatureModel.rootFeature.clone(this, complete); for (final Constraint constraint : oldFeatureModel.constraints) { this.addConstraint(new Constraint(this, constraint.getNode().clone())); } } } else { final HashSet<Feature> featuresToInclude = new HashSet<>(); Features.getAllFeatures(featuresToInclude, newRoot); this.featureOrderList = new LinkedList<>(); for (String featureName : oldFeatureModel.featureOrderList) { final Feature feature = this.getFeature(featureName); if (feature != null && featuresToInclude.contains(feature)) { this.featureOrderList.add(feature.getName()); } } this.rootFeature = newRoot.clone(this, complete); for (final Constraint constraint : oldFeatureModel.constraints) { if (featuresToInclude.containsAll(constraint.getContainedFeatures())) { this.addConstraint(new Constraint(this, constraint.getNode().clone())); } } } this.featureOrderUserDefined = oldFeatureModel.featureOrderUserDefined; this.featureOrderInXML = oldFeatureModel.featureOrderInXML; if (complete) { this.annotations = new LinkedList<String>(oldFeatureModel.annotations); this.comments = new LinkedList<String>(oldFeatureModel.comments); this.layout = oldFeatureModel.layout.clone(); } else { this.comments = Collections.emptyList(); this.annotations = Collections.emptyList(); this.layout = new FeatureModelLayout(); } } ======= this.model = oldFeatureModel.model.clone(); } >>>>>>> this.model = oldFeatureModel.model.clone(); } <<<<<<< if (rootFeature != null) { while (rootFeature.hasChildren()) { Feature child = rootFeature.getLastChild(); deleteChildFeatures(child); rootFeature.removeChild(child); featureTable.remove(child.getName()); } rootFeature = null; } featureTable.clear(); renamingsManager.clear(); constraints.clear(); if (comments != null) { comments.clear(); } if (annotations != null) { annotations.clear(); } featureOrderList.clear(); } private void deleteChildFeatures(Feature feature) { while (feature.hasChildren()) { Feature child = feature.getLastChild(); deleteChildFeatures(child); feature.removeChild(child); featureTable.remove(child.getName()); } } /** * Creates a default {@link FeatureModel} with a root feature named as the project and a * child feature named base. * * @param projectName The name of the project */ ======= FeatureUtils.reset(model); } >>>>>>> FeatureUtils.reset(model); } /** * Creates a default {@link FeatureModel} with a root feature named as the project and a * child feature named base. * * @param projectName The name of the project */ <<<<<<< String rootName = getValidJavaIdentifier(projectName); if (rootName.isEmpty()) { rootName = "Root"; } if (featureTable.isEmpty()) { rootFeature = new Feature(this, rootName); addFeature(rootFeature); } Feature feature = new Feature(this, "Base"); addFeature(feature); rootFeature.addChild(feature); rootFeature.setAbstract(true); } /** * Removes all invalid java identifiers form a given string. */ private String getValidJavaIdentifier(String s) { StringBuilder stringBuilder = new StringBuilder(); int i = 0; for (; i < s.length(); i++) { if (Character.isJavaIdentifierStart(s.charAt(i))) { stringBuilder.append(s.charAt(i)); i++; break; } } for (; i < s.length(); i++) { if (Character.isJavaIdentifierPart(s.charAt(i))) { stringBuilder.append(s.charAt(i)); } } return stringBuilder.toString(); } /* ***************************************************************** * * Feature handling * *******************************************************************/ ======= FeatureUtils.createDefaultValues(model, projectName); } >>>>>>> FeatureUtils.createDefaultValues(model, projectName); } <<<<<<< /** * @return The {@link Feature} with the given name or {@code null} if there is no feature with this name. */ ======= >>>>>>> /** * @return The {@link Feature} with the given name or {@code null} if there is no feature with this name. */ <<<<<<< /** * * @return A list of all concrete features. This list is in preorder of the tree. */ ======= >>>>>>> /** * * @return A list of all concrete features. This list is in preorder of the tree. */ <<<<<<< List<Feature> concreteFeatures = new LinkedList<Feature>(); if (rootFeature != null) { getConcreteFeatures(rootFeature, concreteFeatures); } return Collections.unmodifiableCollection(concreteFeatures); } private void getConcreteFeatures(Feature feature, List<Feature> concreteFeatures) { if (feature.isConcrete()) { concreteFeatures.add(feature); } for (Feature child : feature.getChildren()) { getConcreteFeatures(child, concreteFeatures); } } /** * * @return A list of all concrete feature names. This list is in preorder of the tree. */ ======= return Functional.toList(Functional.map(FeatureUtils.getConcreteFeatures(model), FeatureUtils.IFEATURE_TO_FEATURE)); } >>>>>>> return Functional.toList(Functional.map(FeatureUtils.getConcreteFeatures(model), FeatureUtils.IFEATURE_TO_FEATURE)); } /** * * @return A list of all concrete feature names. This list is in preorder of the tree. */ <<<<<<< private void getFeaturesPreorder(Feature feature, List<Feature> preorderFeatures) { preorderFeatures.add(feature); for (Feature child : feature.getChildren()) { getFeaturesPreorder(child, preorderFeatures); } } ======= >>>>>>> <<<<<<< List<String> preorderFeaturesNames = new LinkedList<String>(); for (Feature f : getFeaturesPreorder()) { preorderFeaturesNames.add(f.getName()); } return preorderFeaturesNames; } /** * @return <code>true</code> if a feature with the given name exists and is concrete. * @deprecated Will be removed in a future release. Use {@link #getFeature(String)}.isConcrete() instead. */ ======= return FeatureUtils.getFeatureNamesPreorder(model); } >>>>>>> return FeatureUtils.getFeatureNamesPreorder(model); } /** * @return <code>true</code> if a feature with the given name exists and is concrete. * @deprecated Will be removed in a future release. Use {@link #getFeature(String)}.isConcrete() instead. */ <<<<<<< /** * @return the featureTable */ ======= >>>>>>> /** * @return the featureTable */ <<<<<<< // the root can not be deleted if (feature == rootFeature) { return false; } // check if it exists String name = feature.getName(); if (!featureTable.containsKey(name)) { return false; } // use the group type of the feature to delete Feature parent = feature.getParent(); if (parent.getChildrenCount() == 1) { if (feature.isAnd()) { parent.setAnd(); } else if (feature.isAlternative()) { parent.setAlternative(); } else { parent.setOr(); } } // add children to parent int index = parent.getChildIndex(feature); while (feature.hasChildren()) { parent.addChildAtPosition(index, feature.removeLastChild()); } // delete feature parent.removeChild(feature); featureTable.remove(name); featureOrderList.remove(name); return true; } ======= return FeatureUtils.deleteFeature(model, convert(feature)); } >>>>>>> return FeatureUtils.deleteFeature(model, convert(feature)); } <<<<<<< /** * * @param constraint * @return The position of the given {@link Constraint} or * -1 if it does not exist. */ ======= >>>>>>> <<<<<<< /** * Refreshes the diagram colors. */ ======= >>>>>>> /** * Refreshes the diagram colors. */ <<<<<<< fireEvent(REDRAW_DIAGRAM); } private final void fireEvent(final String action) { final PropertyChangeEvent event = new PropertyChangeEvent(this, action, Boolean.FALSE, Boolean.TRUE); for (PropertyChangeListener listener : listenerList) { listener.propertyChange(event); } } public final void fireEvent(PropertyChangeEvent event) { for (PropertyChangeListener listener : listenerList) { listener.propertyChange(event); } } ======= FeatureUtils.redrawDiagram(model); } >>>>>>> FeatureUtils.redrawDiagram(model); } <<<<<<< final FeatureModel clone = new FeatureModel(); clone.featureTable.putAll(featureTable); if (rootFeature == null) { // TODO this should never happen clone.rootFeature = new Feature(clone, "Root"); clone.featureTable.put("root", clone.rootFeature); } else { clone.rootFeature = clone.getFeature(rootFeature.getName()); } clone.constraints.addAll(constraints); clone.annotations.addAll(annotations); clone.comments.addAll(comments); return clone; } /** * Will return the value of clone(true). * * @return a deep copy from the feature model * * @see #clone(boolean) */ ======= return new FeatureModel(model.clone()); } >>>>>>> return new FeatureModel(model.clone()); } /** * Will return the value of clone(true). * * @return a deep copy from the feature model * * @see #clone(boolean) */ <<<<<<< return deepClone(true); } /** * Clones the feature model. * Makes a deep copy from all fields in the model.</br> * Note that: {@code fm == fm.clone(false)} and {@code fm == fm.clone(true)} are {@code false} in every case. * * @param complete If {@code false} the fields annotations, comments, colorschemeTable and layout * are set to {@code null} for a faster cloning process. * @return a deep copy from the feature model * * @see #clone() */ ======= return (FeatureModel) model.clone(); } >>>>>>> return (FeatureModel) model.clone(); } /** * Clones the feature model. * Makes a deep copy from all fields in the model.</br> * Note that: {@code fm == fm.clone(false)} and {@code fm == fm.clone(true)} are {@code false} in every case. * * @param complete If {@code false} the fields annotations, comments, colorschemeTable and layout * are set to {@code null} for a faster cloning process. * @return a deep copy from the feature model * * @see #clone() */ <<<<<<< for (Feature f : featureTable.values()) { if (!f.equals(rootFeature) && f.getParent().isAnd() && !f.isMandatory()) return true; } return false; ======= return FeatureUtils.hasOptionalFeatures(model); >>>>>>> return FeatureUtils.hasOptionalFeatures(model); <<<<<<< /** * @return true if feature model contains or group otherwise false */ ======= >>>>>>> /** * @return true if feature model contains or group otherwise false */ <<<<<<< /** * @return number of or groups contained in the feature model */ ======= >>>>>>> /** * @return number of or groups contained in the feature model */ <<<<<<< int count = 0; for (Feature f : featureTable.values()) { if (f.getChildrenCount() > 1 && f.isOr()) { count++; } } return count; } ======= return FeatureUtils.numOrGroup(model); } >>>>>>> return FeatureUtils.numOrGroup(model); } <<<<<<< int count = 0; for (Feature f : featureTable.values()) { if (f.getChildrenCount() > 1 && f.isAlternative()) { count++; } } return count; } /** * * @return <code>true</code> if the feature model contains a hidden feature */ ======= return FeatureUtils.numAlternativeGroup(model); } >>>>>>> return FeatureUtils.numAlternativeGroup(model); } /** * * @return <code>true</code> if the feature model contains a hidden feature */ <<<<<<< String x = ""; try { x = toString(getRoot()); for (Constraint c : getConstraints()) { x += c.toString() + " "; } } catch (Exception e) { return EMPTY_FEATURE_MODEL; } return x; } private String toString(Feature feature) { String x = feature.getName(); if (!feature.hasChildren()) { return x; } if (feature.isOr()) { x += " or ["; } else if (feature.isAlternative()) { x += " alt ["; } else { x += " and ["; } for (Feature child : feature.getChildren()) { x += " "; if (feature.isAnd()) { if (child.isMandatory()) { x += "M "; } else { x += "O "; } } if (child.hasChildren()) { x += toString(child); } else { x += child.getName(); } } return x + " ] "; } ======= return FeatureUtils.toString(model); } >>>>>>> return FeatureUtils.toString(model); }
<<<<<<< import de.ovgu.featureide.fm.core.base.event.IEventManager; ======= import de.ovgu.featureide.fm.core.base.impl.Constraint; >>>>>>> import de.ovgu.featureide.fm.core.base.event.IEventManager; import de.ovgu.featureide.fm.core.base.impl.Constraint;
<<<<<<< try (Scanner master = connMaster.createScanner(masterTable, Authorizations.EMPTY); Scanner peer = connPeer.createScanner(peerTable, Authorizations.EMPTY)) { Iterator<Entry<Key,Value>> masterIter = master.iterator(), peerIter = peer.iterator(); Entry<Key,Value> masterEntry = null, peerEntry = null; while (masterIter.hasNext() && peerIter.hasNext()) { masterEntry = masterIter.next(); peerEntry = peerIter.next(); Assert.assertEquals(masterEntry.getKey() + " was not equal to " + peerEntry.getKey(), 0, masterEntry.getKey().compareTo(peerEntry.getKey(), PartialKey.ROW_COLFAM_COLQUAL_COLVIS)); Assert.assertEquals(masterEntry.getValue(), peerEntry.getValue()); } ======= Scanner master = connMaster.createScanner(masterTable, Authorizations.EMPTY), peer = connPeer.createScanner(peerTable, Authorizations.EMPTY); Iterator<Entry<Key,Value>> masterIter = master.iterator(), peerIter = peer.iterator(); Entry<Key,Value> masterEntry = null, peerEntry = null; while (masterIter.hasNext() && peerIter.hasNext()) { masterEntry = masterIter.next(); peerEntry = peerIter.next(); assertEquals(masterEntry.getKey() + " was not equal to " + peerEntry.getKey(), 0, masterEntry.getKey().compareTo(peerEntry.getKey(), PartialKey.ROW_COLFAM_COLQUAL_COLVIS)); assertEquals(masterEntry.getValue(), peerEntry.getValue()); } >>>>>>> try (Scanner master = connMaster.createScanner(masterTable, Authorizations.EMPTY); Scanner peer = connPeer.createScanner(peerTable, Authorizations.EMPTY)) { Iterator<Entry<Key,Value>> masterIter = master.iterator(), peerIter = peer.iterator(); Entry<Key,Value> masterEntry = null, peerEntry = null; while (masterIter.hasNext() && peerIter.hasNext()) { masterEntry = masterIter.next(); peerEntry = peerIter.next(); assertEquals(masterEntry.getKey() + " was not equal to " + peerEntry.getKey(), 0, masterEntry.getKey().compareTo(peerEntry.getKey(), PartialKey.ROW_COLFAM_COLQUAL_COLVIS)); assertEquals(masterEntry.getValue(), peerEntry.getValue()); } <<<<<<< Assert.assertFalse("Had more data to read from the master", masterIter.hasNext()); Assert.assertFalse("Had more data to read from the peer", peerIter.hasNext()); } ======= assertFalse("Had more data to read from the master", masterIter.hasNext()); assertFalse("Had more data to read from the peer", peerIter.hasNext()); >>>>>>> assertFalse("Had more data to read from the master", masterIter.hasNext()); assertFalse("Had more data to read from the peer", peerIter.hasNext()); }
<<<<<<< import de.ovgu.featureide.fm.core.FMCorePlugin; import de.ovgu.featureide.fm.core.FeatureModelAnalyzer; ======= >>>>>>> import de.ovgu.featureide.fm.core.FMCorePlugin; import de.ovgu.featureide.fm.core.FeatureModelAnalyzer; <<<<<<< public class FeatureProject implements IFeatureProject, IResourceChangeListener, IBuilderMarkerHandler, IEventListener { ======= public class FeatureProject extends BuilderMarkerHandler implements IFeatureProject, IResourceChangeListener { >>>>>>> public class FeatureProject extends BuilderMarkerHandler implements IFeatureProject, IResourceChangeListener { <<<<<<< ======= SimpleFileHandler.load(Paths.get(orderFile.getLocationURI()), featureModel, new FeatureOrderFormat()); >>>>>>> SimpleFileHandler.load(Paths.get(orderFile.getLocationURI()), featureModel, new FeatureOrderFormat()); <<<<<<< ======= >>>>>>> <<<<<<< final FileHandler<Configuration> fileHandler = ConfigurationManager.getFileHandler(Paths.get(resource.getLocationURI()), model); ======= final FileHandler<Configuration> fileHandler = ConfigurationIO.getInstance().getFileHandler(Paths.get(resource.getLocationURI())); fileHandler.getObject().initFeatures(featureModel); >>>>>>> final FileHandler<Configuration> fileHandler = ConfigurationIO.getInstance().getFileHandler(Paths.get(resource.getLocationURI())); fileHandler.getObject().initFeatures(featureModel); <<<<<<< final Configuration configuration = new Configuration(featureModelManager.getObject()); ======= final IFeatureModel featureModel = featureModelManager.getObject(); >>>>>>> final FeatureModelFormula featureModel = featureModelManager.getPersistentFormula();
<<<<<<< if (key.getColumnFamily().equals(DataFileColumnFamily.NAME)) { String[] sizeEntries = new String(entry.getValue().get()).split(","); ======= if (key.getColumnFamily().equals(Constants.METADATA_DATAFILE_COLUMN_FAMILY)) { String[] sizeEntries = new String(entry.getValue().get(), Constants.UTF8).split(","); >>>>>>> if (key.getColumnFamily().equals(DataFileColumnFamily.NAME)) { String[] sizeEntries = new String(entry.getValue().get(), Constants.UTF8).split(",");
<<<<<<< ======= import java.io.FileNotFoundException; import java.nio.file.Paths; >>>>>>> import java.nio.file.Paths; <<<<<<< @Override public boolean hasValidFeatureModel() { return !invalidFeatureModel; } ======= public ConfigurationMatrix getConfigurationMatrix() { ConfigurationMatrix matrix = new ConfigurationMatrix(featureModel, Paths.get(file.getParent().getLocationURI())); matrix.readConfigurations(file.getName()); return matrix; } >>>>>>> @Override public boolean hasValidFeatureModel() { return !invalidFeatureModel; } public ConfigurationMatrix getConfigurationMatrix() { ConfigurationMatrix matrix = new ConfigurationMatrix(featureModel, Paths.get(file.getParent().getLocationURI())); matrix.readConfigurations(file.getName()); return matrix; }
<<<<<<< public CalculateDependencyAction(Object viewer, IFeatureModelManager featureModelManager) { super(CALCULATE_DEPENDENCY, ID, featureModelManager); ======= /** * Constructor. * * @param viewer viewer * @param featureModel The complete feature model */ public CalculateDependencyAction(Object viewer, IFeatureModel featureModel) { super(CALCULATE_DEPENDENCY); this.featureModel = featureModel; setId(ID); >>>>>>> /** * Constructor. * * @param viewer viewer * @param featureModel The complete feature model */ public CalculateDependencyAction(Object viewer, IFeatureModelManager featureModelManager) { super(CALCULATE_DEPENDENCY, ID, featureModelManager);
<<<<<<< import de.ovgu.featureide.fm.core.base.impl.FMFormatManager; import de.ovgu.featureide.fm.core.base.impl.FeatureModel; ======= import de.ovgu.featureide.fm.core.base.impl.DefaultFeatureModelFactory; >>>>>>> import de.ovgu.featureide.fm.core.base.impl.DefaultFeatureModelFactory; import de.ovgu.featureide.fm.core.base.impl.FMFormatManager; <<<<<<< IFeatureModel fm = new FeatureModel("") { // display file name at JUnit view public String toString() { return f.getName(); }; }; FileHandler.load(f.toPath(), fm, FMFormatManager.getInstance()); ======= final IFeatureModel fm = DefaultFeatureModelFactory.getInstance().createFeatureModel(); FileHandler.load(f.toPath(), fm, new XmlFeatureModelFormat()); >>>>>>> final IFeatureModel fm = DefaultFeatureModelFactory.getInstance().createFeatureModel(); FileHandler.load(f.toPath(), fm, FMFormatManager.getInstance());
<<<<<<< import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.content.IContentDescription; import org.eclipse.core.runtime.content.IContentType; ======= import org.eclipse.jface.action.Action; import org.eclipse.jface.action.IMenuListener; import org.eclipse.jface.action.IMenuManager; >>>>>>> import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.content.IContentDescription; import org.eclipse.core.runtime.content.IContentType; import org.eclipse.jface.action.IMenuListener; import org.eclipse.jface.action.IMenuManager; <<<<<<< import de.ovgu.featureide.ui.UIPlugin; ======= import de.ovgu.featureide.fm.ui.FMUIPlugin; import de.ovgu.featureide.fm.ui.editors.featuremodel.actions.colors.SetFeatureColorAction; import de.ovgu.featureide.ui.UIPlugin; import de.ovgu.featureide.ui.views.collaboration.action.SetColorSchemeAction; >>>>>>> import de.ovgu.featureide.fm.ui.editors.featuremodel.actions.colors.SetFeatureColorAction; import de.ovgu.featureide.ui.UIPlugin; <<<<<<< public class ConfigurationMap extends ViewPart implements ICustomTableHeaderSelectionListener { ======= public class ConfigurationMap extends ViewPart { public static final String ID = UIPlugin.PLUGIN_ID + ".view1"; >>>>>>> public class ConfigurationMap extends ViewPart implements ICustomTableHeaderSelectionListener { public static final String ID = UIPlugin.PLUGIN_ID + ".view1"; <<<<<<< ======= private ConfigMapRefreshAction refresh; >>>>>>> private ConfigMapRefreshAction refresh;
<<<<<<< ======= import de.ovgu.featureide.fm.core.annotation.LogService; import de.ovgu.featureide.fm.core.annotation.LogService.LogLevel; import de.ovgu.featureide.fm.core.base.IFeature; 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.base.IFeature; 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.ui.UIPlugin; ======= import de.ovgu.featureide.fm.core.color.FeatureColorManager; >>>>>>> import de.ovgu.featureide.fm.core.color.FeatureColorManager; import de.ovgu.featureide.ui.UIPlugin;
<<<<<<< * * @author Sebastian Krieter * ======= * * @author Thomas Thuem * >>>>>>> * * @author Sebastian Krieter <<<<<<< @Override ======= /* * (non-Javadoc) * @see de.ovgu.featureide.core.internal.IMarkerHandler#createBuilderMarker(org .eclipse.core.resources.IResource, java.lang.String, int, int) */ @Override >>>>>>> @Override <<<<<<< EclipseMarkerHandler.deleteBuilderMarkers(resource, depth); ======= if ((resource != null) && resource.exists()) { try { resource.deleteMarkers(BUILDER_MARKER, false, depth); } catch (final CoreException e) { CorePlugin.getDefault().logError(e); } } >>>>>>> EclipseMarkerHandler.deleteBuilderMarkers(resource, depth); <<<<<<< EclipseMarkerHandler.createConfigurationMarker(resource, message, lineNumber, severity); ======= if (hasMarker(resource, message, lineNumber)) { return; } try { final IMarker marker = resource.createMarker(CONFIGURATION_MARKER); final MarkerInfo info = ((Workspace) resource.getWorkspace()).getMarkerManager().findMarkerInfo(resource, marker.getId()); if (marker.exists() && (info != null)) { marker.setAttribute(IMarker.MESSAGE, message); marker.setAttribute(IMarker.SEVERITY, severity); marker.setAttribute(IMarker.LINE_NUMBER, lineNumber); } else { System.err.println(info); } } catch (final CoreException e) { CorePlugin.getDefault().logError(e); } } /** * @param resource * @param message * @param lineNumber * @return */ private boolean hasMarker(final IResource resource, final String message, final int lineNumber) { try { final IMarker[] marker = resource.findMarkers(CONFIGURATION_MARKER, false, IResource.DEPTH_ZERO); if (marker != null) { for (final IMarker m : marker) { if (m != null) { final Object markerMessage = m.getAttribute(IMarker.MESSAGE); final Object markerLine = m.getAttribute(IMarker.LINE_NUMBER); if ((markerMessage != null) && markerMessage.equals(message) && (markerLine != null) && markerLine.equals(lineNumber)) { return true; } } } } } catch (final CoreException e) { CorePlugin.getDefault().logError(e); } return false; >>>>>>> EclipseMarkerHandler.createConfigurationMarker(resource, message, lineNumber, severity); <<<<<<< EclipseMarkerHandler.deleteConfigurationMarkers(resource, depth); ======= try { resource.deleteMarkers(CONFIGURATION_MARKER, false, depth); } catch (final CoreException e) { CorePlugin.getDefault().logError(e); } >>>>>>> EclipseMarkerHandler.deleteConfigurationMarkers(resource, depth);
<<<<<<< private ConstraintViewSettingsMenu settingsMenu; ======= private Explanation<?> explanation; >>>>>>> private ConstraintViewSettingsMenu settingsMenu; private Explanation<?> explanation; <<<<<<< if (settingsMenu != null) { settingsMenu.update(this); } ======= refreshConstraints(currentModel); } >>>>>>> if (settingsMenu != null) { settingsMenu.update(this); } refreshConstraints(currentModel); } <<<<<<< ======= return constraintList; >>>>>>> return constraintList;
<<<<<<< HostAndPort address = startServer(getServerConfigurationFactory().getSystemConfiguration(), clientAddress.getHostText(), Property.TSERV_CLIENTPORT, processor, "Thrift Client Server"); log.info("address = {}", address); ======= HostAndPort address = startServer(getServerConfigurationFactory().getConfiguration(), clientAddress.getHost(), Property.TSERV_CLIENTPORT, processor, "Thrift Client Server"); log.info("address = " + address); >>>>>>> HostAndPort address = startServer(getServerConfigurationFactory().getSystemConfiguration(), clientAddress.getHost(), Property.TSERV_CLIENTPORT, processor, "Thrift Client Server"); log.info("address = {}", address);
<<<<<<< Map<IFeature, List<IFeature>> removalMap = new HashMap<IFeature, List<IFeature>>(); List<IFeature> alreadyDeleted = new LinkedList<IFeature>(); ======= Map<Feature, List<Feature>> removalMap = new HashMap<>(); List<Feature> alreadyDeleted = new LinkedList<>(); List<Feature> commonAncestorList = null; >>>>>>> Map<IFeature, List<IFeature>> removalMap = new HashMap<>(); List<IFeature> alreadyDeleted = new LinkedList<>(); List<IFeature> commonAncestorList = null; <<<<<<< private void removeFeature(Object element, Map<IFeature, List<IFeature>> removalMap, List<IFeature> alreadyDeleted) { IFeature feature = null; if (element instanceof IFeature) { feature = ((IFeature) element); ======= private Feature removeFeature(Object element, Map<Feature, List<Feature>> removalMap, List<Feature> alreadyDeleted) { Feature feature = null; if (element instanceof Feature) { feature = ((Feature) element); >>>>>>> private IFeature removeFeature(Object element, Map<IFeature, List<IFeature>> removalMap, List<IFeature> alreadyDeleted) { IFeature feature = null; if (element instanceof IFeature) { feature = ((IFeature) element); <<<<<<< if (feature.getStructure().getRelevantConstraints().isEmpty()) { ======= final Feature parent = feature.getParent(); if (feature.getRelevantConstraints().isEmpty()) { >>>>>>> final IFeature parent = feature.getStructure().getParent().getFeature(); if (feature.getStructure().getRelevantConstraints().isEmpty()) {
<<<<<<< /** * @param label Description of this operation to be used in the menu * @param feature feature on which this operation will be executed * */ public CollapseFeatureOperation(String featureName, IGraphicalFeatureModel graphicalFeatureModel, String operationLabel) { super(graphicalFeatureModel, operationLabel); this.featureName = featureName; ======= public CollapseFeatureOperation(IFeature feature, IGraphicalFeatureModel graphicalFeatureModel, String operationLabel) { super(graphicalFeatureModel.getFeatureModel(), operationLabel); this.graphicalFeatureModel = graphicalFeatureModel; this.feature = feature; >>>>>>> public CollapseFeatureOperation(String featureName, IGraphicalFeatureModel graphicalFeatureModel, String operationLabel) { super(graphicalFeatureModel, operationLabel); this.featureName = featureName;