[Releng] Fix MarketplaceCatalogGenerator for new sat4j version.
diff --git a/plugins/org.eclipse.oomph.p2.core/src/org/eclipse/oomph/p2/core/P2Util.java b/plugins/org.eclipse.oomph.p2.core/src/org/eclipse/oomph/p2/core/P2Util.java
index 39a870c..67e709a 100644
--- a/plugins/org.eclipse.oomph.p2.core/src/org/eclipse/oomph/p2/core/P2Util.java
+++ b/plugins/org.eclipse.oomph.p2.core/src/org/eclipse/oomph/p2/core/P2Util.java
@@ -146,18 +146,21 @@
 
   public static void copyTrustPreferences(Profile sourceProfile, Profile targetProfile)
   {
-    IEclipsePreferences source = getTrustPreferences(sourceProfile);
-    IEclipsePreferences target = getTrustPreferences(targetProfile);
-    try
+    if (sourceProfile != null && targetProfile != null)
     {
-      for (String key : source.keys())
+      IEclipsePreferences source = getTrustPreferences(sourceProfile);
+      IEclipsePreferences target = getTrustPreferences(targetProfile);
+      try
       {
-        target.put(key, source.get(key, null));
+        for (String key : source.keys())
+        {
+          target.put(key, source.get(key, null));
+        }
       }
-    }
-    catch (BackingStoreException ex)
-    {
-      P2CorePlugin.INSTANCE.log(ex);
+      catch (BackingStoreException ex)
+      {
+        P2CorePlugin.INSTANCE.log(ex);
+      }
     }
   }
 
diff --git a/plugins/org.eclipse.oomph.setup.installer/src/org/eclipse/oomph/setup/internal/installer/MarketplaceCatalogGenerator.java b/plugins/org.eclipse.oomph.setup.installer/src/org/eclipse/oomph/setup/internal/installer/MarketplaceCatalogGenerator.java
index 7387cbb..aba54dd 100644
--- a/plugins/org.eclipse.oomph.setup.installer/src/org/eclipse/oomph/setup/internal/installer/MarketplaceCatalogGenerator.java
+++ b/plugins/org.eclipse.oomph.setup.installer/src/org/eclipse/oomph/setup/internal/installer/MarketplaceCatalogGenerator.java
@@ -151,6 +151,24 @@
   @SuppressWarnings("restriction")
   public Object start(IApplicationContext context) throws Exception
   {
+    Job.getJobManager().addJobChangeListener(new JobChangeAdapter()
+    {
+      @Override
+      public void done(IJobChangeEvent event)
+      {
+        Job job = event.getJob();
+        if (job.getClass().getName().equals("org.eclipse.equinox.internal.p2.director.Projector$ExplanationJob"))
+        {
+          Object projector = ReflectUtil.getValue("this$0", job);
+          Object dependencyHelper = ReflectUtil.getValue("dependencyHelper", projector);
+          Object explainer = ReflectUtil.getValue("solver", dependencyHelper);
+          Object adapter = ReflectUtil.getValue("solver", explainer);
+          Object decorator = ReflectUtil.getValue("solver", adapter);
+          ReflectUtil.invokeMethod("reset", decorator);
+        }
+      }
+    });
+
     String[] arguments = (String[])context.getArguments().get(IApplicationContext.APPLICATION_ARGS);
     Map<String, URI> nodeURIs = new LinkedHashMap<String, URI>();
     outputLocation = File.createTempFile("marketplace", "-report");
diff --git a/plugins/org.eclipse.oomph.setup.p2/src/org/eclipse/oomph/setup/p2/impl/P2TaskImpl.java b/plugins/org.eclipse.oomph.setup.p2/src/org/eclipse/oomph/setup/p2/impl/P2TaskImpl.java
index e3b0a0d..5808d7a 100644
--- a/plugins/org.eclipse.oomph.setup.p2/src/org/eclipse/oomph/setup/p2/impl/P2TaskImpl.java
+++ b/plugins/org.eclipse.oomph.setup.p2/src/org/eclipse/oomph/setup/p2/impl/P2TaskImpl.java
@@ -939,13 +939,17 @@
 
       // Copy the trust preferences of the profile to the self profile if the agents are different, i.e., in the installer.
       Profile selfProfile = P2Util.getAgentManager().getCurrentAgent().getCurrentProfile();
-      if (selfProfile.getAgent() != profile.getAgent())
+      if (selfProfile != null)
       {
-        P2Util.copyTrustPreferences(profile, selfProfile);
-      }
 
-      // Save them globally as well, but don't remove anything from the global preferences.
-      P2Util.saveGlobalTrustPreferences(profile, false);
+        if (selfProfile.getAgent() != profile.getAgent())
+        {
+          P2Util.copyTrustPreferences(profile, selfProfile);
+        }
+
+        // Save them globally as well, but don't remove anything from the global preferences.
+        P2Util.saveGlobalTrustPreferences(profile, false);
+      }
     }
   }