]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.project/src/org/simantics/project/management/GraphBundleEx.java
Platform startup performance improvements
[simantics/platform.git] / bundles / org.simantics.project / src / org / simantics / project / management / GraphBundleEx.java
index f90896fa1d939ba459cd42c785c7cad1de1aabd6..450d7808f36d89c19c035eeb5cf369fc1daeecc8 100644 (file)
@@ -13,6 +13,7 @@ package org.simantics.project.management;
 
 import java.text.SimpleDateFormat;
 import java.util.Date;
+import java.util.function.Supplier;
 
 import org.eclipse.equinox.p2.metadata.IVersionedId;
 import org.eclipse.equinox.p2.metadata.Version;
@@ -60,6 +61,7 @@ public class GraphBundleEx extends GraphBundle implements IVersionedId {
        VersionedId vid;
        
        GraphBundleEx(GraphBundle e) {
+               this.graphSource = e.graphSource;
                this.graph = e.graph;
                this.resource = e.resource;
                this.hashcode = e.hashcode;
@@ -106,6 +108,14 @@ public class GraphBundleEx extends GraphBundle implements IVersionedId {
                this.immutable = isImmutable;
        }
 
+       public GraphBundleEx(String name, Supplier<TransferableGraph1> source, int hashValue, IVersionedId vid, boolean isImmutable) 
+       throws RuntimeBindingException 
+       {
+               super(name, source, hashValue, vid.getId(), vid.getVersion().getSegment(0).toString()+"."+vid.getVersion().getSegment(1).toString()+"."+vid.getVersion().getSegment(2).toString()+"."+vid.getVersion().getSegment(3).toString());
+               this.vid = new VersionedId(id, vid.getVersion());
+               this.immutable = isImmutable;
+       }
+
        public GraphBundleEx(String name, TransferableGraph1 data, IVersionedId vid) 
        throws RuntimeBindingException 
        {