GithubHelp home page GithubHelp logo

variantsync's People

Contributors

1tristan avatar kogoro avatar pmbittner avatar tthuem avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

variantsync's Issues

Compare view does not work

When doing a manual sync, the compare view opens, but no items exist under Compilation Unit.
Also, the cancel action closes the merge view but also marks the change as merged.

Data Structure for Abstract Syntax Trees

For new research projects, we have to abstract from software projects to be able to compare variants and their code fragments.
Therefore, as a first step we want to represent projects and software artefacts in a tree structure.
The following is a first draft for how such an abstract syntax tree (AST) structure could look like:

class AST<Grammar, Value> {
    int UUID;
    Grammar type;
    Value value;
    List<AST<Grammar, Value>> children = new ArrayList<>();

    /// getters, setters, and utility methods here
}

where a Grammar would be an enum over grammar symbols of for example Java or C++ grammar.
The grammar, this describes the type of a node in the tree.

For now, the goal is to stick to a line-based structure such as used in git diff.
Thus, an initial grammar would be:

public enum LineGrammar {
    Directory, File, Line
}

Thus, we would distinguish between directories, files and lines of source code in that file.
For example, the following would be the way to construct a tree for a java Hello World program manually:

AST<LineGrammar, String> srcDir = new AST<>(LineGrammar.Directory, "src");
AST<LineGrammar, String> mainJava = new AST<>(LineGrammar.File, "Main.java");
srcDir.children.add(mainJava);
mainJava.children.addAll(Arrays.asList(
        new AST<>(LineGrammar.Line, "public class Main {"),
        new AST<>(LineGrammar.Line, "    public static void main(String[] args)"),
        new AST<>(LineGrammar.Line, "        System.out.println(\"Hello World\");"),
        new AST<>(LineGrammar.Line, "    }"),
        new AST<>(LineGrammar.Line, "}")));

This tree structure should be part of the VariantSyncCoreLibrary from issue #49.

Importing and Exporting AST to and from JSON

The ASTs from issue #50 have to be serializable sucht that we can compare them across sessions and between tools.
Therefore, we agreed on a common JSON format:

{
    "uuid" : 1,
    "value" : "some string",
    "grammar_type" : "grammar type as string",
    "children" : [
        "... further nodes in recursive structure"
    ]
}

So the goal is, to implement and exporter and an importer to serialize ASTs into that format.

NullPointerException in Source Focused View

Potentially because there was no variantSyncInfo project.

java.lang.NullPointerException
    at de.ovgu.variantsync.ui.view.mergeprocess.SourceFocusedView.createPartControl(SourceFocusedView.java:70)
    at org.eclipse.ui.internal.e4.compatibility.CompatibilityPart.createPartControl(CompatibilityPart.java:151)
    at org.eclipse.ui.internal.e4.compatibility.CompatibilityView.createPartControl(CompatibilityView.java:143)
    at org.eclipse.ui.internal.e4.compatibility.CompatibilityPart.create(CompatibilityPart.java:341)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:54)
    at org.eclipse.e4.core.internal.di.InjectorImpl.processAnnotated(InjectorImpl.java:966)
    at org.eclipse.e4.core.internal.di.InjectorImpl.processAnnotated(InjectorImpl.java:931)
    at org.eclipse.e4.core.internal.di.InjectorImpl.inject(InjectorImpl.java:151)
    at org.eclipse.e4.core.internal.di.InjectorImpl.internalMake(InjectorImpl.java:375)
    at org.eclipse.e4.core.internal.di.InjectorImpl.make(InjectorImpl.java:294)
    at org.eclipse.e4.core.contexts.ContextInjectionFactory.make(ContextInjectionFactory.java:162)
    at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.createFromBundle(ReflectionContributionFactory.java:105)
    at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.doCreate(ReflectionContributionFactory.java:74)
    at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.create(ReflectionContributionFactory.java:56)
    at org.eclipse.e4.ui.workbench.renderers.swt.ContributedPartRenderer.createWidget(ContributedPartRenderer.java:129)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createWidget(PartRenderingEngine.java:975)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:651)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$1.run(PartRenderingEngine.java:536)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:520)
    at org.eclipse.e4.ui.workbench.renderers.swt.ElementReferenceRenderer.createWidget(ElementReferenceRenderer.java:70)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createWidget(PartRenderingEngine.java:975)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:651)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:757)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.access$0(PartRenderingEngine.java:728)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$2.run(PartRenderingEngine.java:722)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:706)
    at org.eclipse.e4.ui.workbench.renderers.swt.StackRenderer.showTab(StackRenderer.java:1317)
    at org.eclipse.e4.ui.workbench.renderers.swt.LazyStackRenderer$1.handleEvent(LazyStackRenderer.java:72)
    at org.eclipse.e4.ui.services.internal.events.UIEventHandler$1.run(UIEventHandler.java:40)
    at org.eclipse.swt.widgets.Synchronizer.syncExec(Synchronizer.java:233)
    at org.eclipse.ui.internal.UISynchronizer.syncExec(UISynchronizer.java:145)
    at org.eclipse.swt.widgets.Display.syncExec(Display.java:4813)
    at org.eclipse.e4.ui.internal.workbench.swt.E4Application$1.syncExec(E4Application.java:211)
    at org.eclipse.e4.ui.services.internal.events.UIEventHandler.handleEvent(UIEventHandler.java:36)
    at org.eclipse.equinox.internal.event.EventHandlerWrapper.handleEvent(EventHandlerWrapper.java:201)
    at org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:197)
    at org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:1)
    at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
    at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148)
    at org.eclipse.equinox.internal.event.EventAdminImpl.dispatchEvent(EventAdminImpl.java:135)
    at org.eclipse.equinox.internal.event.EventAdminImpl.sendEvent(EventAdminImpl.java:78)
    at org.eclipse.equinox.internal.event.EventComponent.sendEvent(EventComponent.java:39)
    at org.eclipse.e4.ui.services.internal.events.EventBroker.send(EventBroker.java:94)
    at org.eclipse.e4.ui.internal.workbench.UIEventPublisher.notifyChanged(UIEventPublisher.java:60)
    at org.eclipse.emf.common.notify.impl.BasicNotifierImpl.eNotify(BasicNotifierImpl.java:374)
    at org.eclipse.e4.ui.model.application.ui.impl.ElementContainerImpl.setSelectedElement(ElementContainerImpl.java:173)
    at org.eclipse.e4.ui.internal.workbench.ModelServiceImpl.showElementInWindow(ModelServiceImpl.java:617)
    at org.eclipse.e4.ui.internal.workbench.ModelServiceImpl.bringToTop(ModelServiceImpl.java:581)
    at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.delegateBringToTop(PartServiceImpl.java:770)
    at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.activate(PartServiceImpl.java:744)
    at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.activate(PartServiceImpl.java:682)
    at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.activate(PartServiceImpl.java:677)
    at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.showPart(PartServiceImpl.java:1205)
    at org.eclipse.ui.internal.WorkbenchPage.showPart(WorkbenchPage.java:1283)
    at org.eclipse.ui.internal.WorkbenchPage.busyShowView(WorkbenchPage.java:1274)
    at org.eclipse.ui.internal.WorkbenchPage$12.run(WorkbenchPage.java:4316)
    at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
    at org.eclipse.ui.internal.WorkbenchPage.showView(WorkbenchPage.java:4312)
    at org.eclipse.ui.internal.WorkbenchPage.showView(WorkbenchPage.java:4292)
    at org.eclipse.ui.handlers.ShowViewHandler.openView(ShowViewHandler.java:132)
    at org.eclipse.ui.handlers.ShowViewHandler.openOther(ShowViewHandler.java:110)
    at org.eclipse.ui.handlers.ShowViewHandler.execute(ShowViewHandler.java:77)
    at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:295)
    at org.eclipse.ui.internal.handlers.E4HandlerProxy.execute(E4HandlerProxy.java:90)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:54)
    at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:282)
    at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:264)
    at org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:132)
    at org.eclipse.e4.core.commands.internal.HandlerServiceHandler.execute(HandlerServiceHandler.java:152)
    at org.eclipse.core.commands.Command.executeWithChecks(Command.java:494)
    at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:488)
    at org.eclipse.e4.core.commands.internal.HandlerServiceImpl.executeHandler(HandlerServiceImpl.java:210)
    at org.eclipse.ui.internal.handlers.LegacyHandlerService.executeCommand(LegacyHandlerService.java:353)
    at org.eclipse.ui.internal.ShowViewMenu$3.run(ShowViewMenu.java:147)
    at org.eclipse.jface.action.Action.runWithEvent(Action.java:473)
    at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:565)
    at org.eclipse.jface.action.ActionContributionItem.lambda$4(ActionContributionItem.java:397)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
    at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4410)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1079)
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4228)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3816)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$4.run(PartRenderingEngine.java:1121)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1022)
    at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:150)
    at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:687)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:604)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:148)
    at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:138)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:388)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:243)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:673)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:610)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1519)
    at org.eclipse.equinox.launcher.Main.main(Main.java:1492)

Simple Parser for Text File Lines

To analyze source code files we have to be able to parse text files to our simple abstract syntax trees from issue #50.
The idea is to create parser with the following interface

public static AST<LineGrammar, String> parseDirectory(java.nio.Path path) {
    /**
      *Traverse the given directory recursively and read the lines of all non-binary files (e.g., .java, .cpp, .txt, ...).
      * Create a node in the tree for each directory, file, and the lines in that file,
      * such that the directory structure is mirrored in the returned tree.
      */
}

Reconsider nature

Reconsider if the variant nature is still needed or if it can be removed.

Make feature expressions read-only when used

Changing a feature expression which is already in use leads to some unresolved questions.

  • Update all markers and mappings when some feature expression changes?
  • ...

For the time being, the feature expressions should be read-only when in use.

Abstract and Extract Existing Feature Trace Infrastructure

Currently, feature traces are implemented as de.tubs.variantsync.core.utilities.IVariantSyncMarker. Such a marker represents an individual mapping for a single chunk of text in a text file (?). To this end, it is represented by an int offset describing the index in the text of the document at which the mapping begins and an int length and the corresponding feature formula (given as a string).

To alternatively replace this (deprecated) representation of feature traces, we first have to introduce interfaces to make the GUI independent from the actual representation of feature traces.
Therefore, follow these steps:

  • Identify where, how, and why IVariantSyncMarkers are used. Where are these stored (in code as well as on disk)? Where is the place where they are linked to the files? Which views displays the markers? Are there any Eclipse dependencies? ... Document your findings with Javadoc and sketch them (e.g., on paper).
  • Depending on what you found, try to abstract and extract all infrastructure on the markers that does not depend on eclipse to the new library. (Dependencies to the FeatureIDE library are fien as we will use that in the VariantSync core library, too.) To this end, come up with suitable interfaces such that the GUI can still communicate to / work with the markes but is independent from these. In fact, the GUI should deal with feature traces that can be realized as markers or with an instance of your AST<LineGrammar, String>. (Later we want to generalize this to AST<G,V> but for now we should keep things simple).
  • Find a suitable place in the VariantSync Eclipse plugin where you can provide instances for your interfaces. Use the implementations you moved to your library.
  • Make sure your extraction was a refactoring: Test that VariantSync still behaves as before (at least as shown in the screencasts such that these can be reproduced).

Handling of info project states

When the feature info project is closed, deleted or missing in any other way, there must be some kind of error handling e.g. show an error marker/popup.
Opening a project should also be possible.
Adding a project should also initialize the projects with feature context expressions etc.

VariantSync Core Library

This is a long term issue.

Core functionalities of VariantSync that are independent from the IDE should be developed independently in a dedicated library.
Thus, the plan is to create a new java library (preferrably as a Maven project of archetype maven-archetype-quickstart in this repository) that can be included as a jar file.
In the later future, core library should hold unified data structures and functionality for

  • Software Artefacts
  • Variants / Clones
  • Project Structure
  • View Configuration (Colours for Traces?)
  • Serialization of Feature Traces
  • Pull-Requests / Cherry Picking / Synchronisation Broadcasting

So the next steps would be:

  1. Setup the library project with package name de.variantsync.core.
  2. Implement data structures: These will be planned with a special issue each.
  3. Refactor the VariantSync Eclipse Plugin to use the library and its content.

Old Interfaces and Classes

In VariantSync there are usages of deprecated Interfaces (IPersistentFormat, APersistentFormat, CoreExtensionLoader, IExtensionLoader). The purpose of this issue is tu track the changes in order to renew the old usages
#45

IFile to Path

In the actual VariantSync version there are many usages and implementations which use deprecated methods.
In a newer version there was a switch from using IFile to Path, so we need to update this
#45 bug

Other file repository than eclipse history

We should discuss and search for a method to handle files and their changes in variants. Git or Mercurial could be a solution. Needs still further investigation and requires an interface on variantsync's side.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.