Community
Participate
Working Groups
When we uninstall the launcher, we set the launcher name property (on the profile) to null. If you then perform another profile change request, the profile properties get copied to an another map. Since it has a value of null, it leads to the following NPE: java.lang.NullPointerException at java.util.Hashtable.put(Hashtable.java:394) at java.util.Hashtable.putAll(Hashtable.java:466) at java.util.Hashtable.<init>(Hashtable.java:197) at org.eclipse.equinox.internal.p2.director.SimplePlanner.createSelectio nContext(SimplePlanner.java:203) at org.eclipse.equinox.internal.p2.director.SimplePlanner.getSolutionFor (SimplePlanner.java:284) at org.eclipse.equinox.internal.p2.director.SimplePlanner.getProvisionin gPlan(SimplePlanner.java:351) I wonder if we should remove the property if there is no launcher installed?
You are right, we should simply remove the property. The issue is likely located in the eclipse touchpoint where we unset the launcher.
(In reply to comment #1) > You are right, we should simply remove the property. > The issue is likely located in the eclipse touchpoint where we unset the > launcher. Yep, that's exactly where it is (the setLauncherName method, or something like that). I'll grab this and get you or Simon to review.
Created attachment 167589 [details] fix v.1 If the launcher name is being set to null, then we remove the property. From the javadocs, if we call remvoe and the property doesn't exist, we're ok.
Simon, can you review this patch?
Make sense and I think this is fine but adding Andrew to also take a quick look.
Created attachment 167953 [details] v2 I don't have any particular problem with the patch, except that it doesn't feel like the full fix to me. Why are we using a Hashtable here in the SimplePlanner? The profileProperties we are working from will be a HashMap, if it ever happens that there are other keys that have null values then we have the same problem again. None of the uses of the selectionContext map require a dictionary, I suggest we change it to a HashMap.
Ian and I talked about this and we like the new patch.