Bug 544975 - 'Open Project' does not refresh before opening

With this change OpenProjectAction will trigger a background refresh for
the project, ensuring that the project resources are up-to-date if the
project changed in the file system while being closed. This can e.g.
occur due to an update in the projects repository.

Change-Id: Ic945accd6ab74e5f7b64b523b1668b5ee5dca18f
Signed-off-by: Simeon Andreev <simeon.danailov.andreev@gmail.com>
diff --git a/core/plugins/org.eclipse.dltk.ui/src/org/eclipse/dltk/internal/ui/actions/OpenProjectAction.java b/core/plugins/org.eclipse.dltk.ui/src/org/eclipse/dltk/internal/ui/actions/OpenProjectAction.java
index 1f91aa5..b852c4e 100644
--- a/core/plugins/org.eclipse.dltk.ui/src/org/eclipse/dltk/internal/ui/actions/OpenProjectAction.java
+++ b/core/plugins/org.eclipse.dltk.ui/src/org/eclipse/dltk/internal/ui/actions/OpenProjectAction.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2017 IBM Corporation and others.
+ * Copyright (c) 2000, 2019 IBM Corporation and others.
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License v. 2.0 which is available at
  * http://www.eclipse.org/legal/epl-2.0.
@@ -14,6 +14,7 @@
 import java.util.List;
 
 import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
 import org.eclipse.core.resources.IResourceChangeEvent;
 import org.eclipse.core.resources.IResourceChangeListener;
 import org.eclipse.core.resources.IResourceDelta;
@@ -175,7 +176,7 @@
 			for (int i = 0; i < projects.length; i++) {
 				IProject project = (IProject) projects[i];
 				try {
-					project.open(new SubProgressMonitor(monitor, 1));
+					project.open(IResource.BACKGROUND_REFRESH, new SubProgressMonitor(monitor, 1));
 				} catch (CoreException e) {
 					if (errorStatus == null)
 						errorStatus = new MultiStatus(DLTKUIPlugin.PLUGIN_ID,