diff --git a/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/internal/preferences/js/JSLibFactory.java b/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/internal/preferences/js/JSLibFactory.java index 37b11d74e..dfdad83f4 100644 --- a/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/internal/preferences/js/JSLibFactory.java +++ b/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/internal/preferences/js/JSLibFactory.java @@ -173,7 +173,11 @@ private JSLibModel getPreviousDefaultModel() { String newText = JSLibXMLLoader.saveToString(getDefaultModel()); if(!f.exists()) { FileUtil.writeFile(f, newText); - return null; + //Previous default model is unknown. The best way is to presume + //that each artifact of the current default model is new + //(so that it will be added), and each artifact in current + //preferences is customized (so that it will be preserved). + return new JSLibModel(); } JSLibModel oldDefaultModel = JSLibXMLLoader.load(FileUtil.readFile(f)); if(newDefaultModel.equals(oldDefaultModel)) {