Bug 100487 [build path] Build Path variables not updated after "Configure Variables" used
Please note this is NOT a duplicate of 82850. Updating a classpath variable from the project's Java Build Path does not reflect a change as expected. Steps to reproduce: 1. Open Project Properties page, and choose Java Build Path. 2. Select the Libraries tab, and click "Add Variable". 3. Note the list of variables shown, and click "Configure Variables". The Classpath Variables dialog is shown. 4. Edit the value of an existing variable for a folder path. Note that the updated value now appears on the Classpath Variables dialog. 5. Click OK. Eclipse will ask you if you want to do a full rebuild. Say "Yes". 6. You are returned to the "Add Variable" dialog. Note that the old values for the variables still appear. Any attempt to "Extend" the changed variable will result in an incorrect path. 7. Close the Variable Extension dialog. Close the "Add Variable" dialog. 8. Click "Add Variable" button again from the Project Properties screen. 9. Note that the new value for the variable is now correctly displayed. This is frustrating since it often means that after editing a variable value, one gets almost to the point of using it only to discover that a good portion of the process now has to be scraped and repeated. Having the new variable values reflected in the list after "Configure Variables" has been clicked would be really helpful.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/VariableBlock.java
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.SubProgressMonitor;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.jface.viewers.IDoubleClickListener;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.viewers.ViewerSorter;
import org.eclipse.jface.window.Window;
import org.eclipse.jdt.core.IClasspathEntry;
import org.eclipse.jdt.core.IJavaModel;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.internal.ui.JavaPlugin;
import org.eclipse.jdt.internal.ui.wizards.NewWizardMessages;
import org.eclipse.jdt.internal.ui.wizards.dialogfields.DialogField;
import org.eclipse.jdt.internal.ui.wizards.dialogfields.IDialogFieldListener;
import org.eclipse.jdt.internal.ui.wizards.dialogfields.IListAdapter;
import org.eclipse.jdt.internal.ui.wizards.dialogfields.LayoutUtil;
import org.eclipse.jdt.internal.ui.wizards.dialogfields.ListDialogField;
public class VariableBlock {