# HG changeset patch # User timkelly # Date 1249579148 18000 # Node ID 89a4ce4b37f586604a4271c86669827dec668723 # Parent bf8d63f38814446376e5c7f8f43236d6d8c912a2 merge in Ken's previous merges and bug 8513. diff -r bf8d63f38814 -r 89a4ce4b37f5 cdt/cdt_6_0_x/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/ICDTLaunchConfigurationConstants.java --- a/cdt/cdt_6_0_x/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/ICDTLaunchConfigurationConstants.java Thu Aug 06 12:03:24 2009 -0500 +++ b/cdt/cdt_6_0_x/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/ICDTLaunchConfigurationConstants.java Thu Aug 06 12:19:08 2009 -0500 @@ -49,6 +49,17 @@ */ public static final String ATTR_PROJECT_NAME = CDT_LAUNCH_ID + ".PROJECT_ATTR"; //$NON-NLS-1$ + /** Launch configuration attribute value constants for build before launch. + */ + public static final int BUILD_BEFORE_LAUNCH_DISABLED = 0; + public static final int BUILD_BEFORE_LAUNCH_ENABLED = 1; + public static final int BUILD_BEFORE_LAUNCH_USE_WORKSPACE_SETTING = 2; + + /** Launch configuration attribute key. The value is the ID of the project's 1.15 + * build configuration that should be used when a build is required before launch. 1.16 + */ + public static final String ATTR_BUILD_BEFORE_LAUNCH = CDT_LAUNCH_ID + ".ATTR_BUILD_BEFORE_LAUNCH_ATTR"; //$NON-NLS-1$ + /** * Launch configuration attribute key. The value is the ID of the project's * build configuration that should be used when a build is required before launch. diff -r bf8d63f38814 -r 89a4ce4b37f5 cdt/cdt_6_0_x/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/AbstractCLaunchDelegate.java --- a/cdt/cdt_6_0_x/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/AbstractCLaunchDelegate.java Thu Aug 06 12:03:24 2009 -0500 +++ b/cdt/cdt_6_0_x/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/AbstractCLaunchDelegate.java Thu Aug 06 12:19:08 2009 -0500 @@ -136,6 +136,10 @@ private List orderedProjects; private String preLaunchBuildConfiguration; + /** + * Used in conjunction with build before launch settings in the main tab. + */ + private boolean buildForLaunchCalled; abstract public void launch(ILaunchConfiguration configuration, String mode, ILaunch launch, IProgressMonitor monitor) throws CoreException; @@ -591,11 +595,24 @@ * @return whether the debug platform should perform an incremental * workspace build before the launch * @throws CoreException - * if an exception occurrs while building + * if an exception occurs while building */ @Override public boolean buildForLaunch(ILaunchConfiguration configuration, String mode, IProgressMonitor monitor) throws CoreException { - //This matches the old code, but I don't know that it is the right behaviour. + + buildForLaunchCalled = true; + + // check the build before launch setting and honor it + int buildBeforeLaunchValue = configuration.getAttribute(ICDTLaunchConfigurationConstants.ATTR_BUILD_BEFORE_LAUNCH, + ICDTLaunchConfigurationConstants.BUILD_BEFORE_LAUNCH_USE_WORKSPACE_SETTING); + + // we shouldn't be getting called if the workspace setting is disabled, so assume we need to + // build unless the user explicitly disabled it in the main tab of the launch. + if (buildBeforeLaunchValue == ICDTLaunchConfigurationConstants.BUILD_BEFORE_LAUNCH_DISABLED) { + return false; + } + + //This matches the old code, but I don't know that it is the right behavior. //We should be building the local project as well, not just the ordered projects if(orderedProjects == null) { return false; @@ -666,6 +683,26 @@ */ @Override public boolean finalLaunchCheck(ILaunchConfiguration configuration, String mode, IProgressMonitor monitor) throws CoreException { + + if (!buildForLaunchCalled) { + // buildForLaunch was not called which means that the workspace pref is disabled. see if the user enabled the + // launch specific setting in the main tab. if so, we do call buildBeforeLaunch here. + if (ICDTLaunchConfigurationConstants.BUILD_BEFORE_LAUNCH_ENABLED == configuration.getAttribute(ICDTLaunchConfigurationConstants.ATTR_BUILD_BEFORE_LAUNCH, + ICDTLaunchConfigurationConstants.BUILD_BEFORE_LAUNCH_USE_WORKSPACE_SETTING)) { + + IProgressMonitor buildMonitor = new SubProgressMonitor(monitor, 10, SubProgressMonitor.PREPEND_MAIN_LABEL_TO_SUBTASK); + buildMonitor.beginTask(LaunchMessages.getString("AbstractCLaunchDelegate.BuildBeforeLaunch"), 10); //$NON-NLS-1$ + buildMonitor.subTask(LaunchMessages.getString("AbstractCLaunchDelegate.PerformingBuild")); //$NON-NLS-1$ + if (buildForLaunch(configuration, mode, new SubProgressMonitor(buildMonitor, 7))) { + buildMonitor.subTask(LaunchMessages.getString("AbstractCLaunchDelegate.PerformingIncrementalBuild")); //$NON-NLS-1$ + ResourcesPlugin.getWorkspace().build(IncrementalProjectBuilder.INCREMENTAL_BUILD, new SubProgressMonitor(buildMonitor, 3)); + } + else { + buildMonitor.worked(3); /* No incremental build required */ + } + } + } + boolean continueLaunch = true; if(orderedProjects == null) { return continueLaunch; @@ -770,6 +807,8 @@ monitor = new NullProgressMonitor(); } + buildForLaunchCalled = false; + int scale = 1000; int totalWork = 2 * scale; diff -r bf8d63f38814 -r 89a4ce4b37f5 cdt/cdt_6_0_x/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/LaunchMessages.properties --- a/cdt/cdt_6_0_x/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/LaunchMessages.properties Thu Aug 06 12:03:24 2009 -0500 +++ b/cdt/cdt_6_0_x/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/LaunchMessages.properties Thu Aug 06 12:19:08 2009 -0500 @@ -30,6 +30,9 @@ AbstractCLaunchDelegate.searching_for_errors_in=Searching for compile errors in AbstractCLaunchDelegate.20=Building prerequisite project list AbstractCLaunchDelegate.Program_is_not_a_recongnized_executable=Program is not a recognized executable. +AbstractCLaunchDelegate.BuildBeforeLaunch=Build before launch - +AbstractCLaunchDelegate.PerformingBuild=Performing required build... +AbstractCLaunchDelegate.PerformingIncrementalBuild=Performing incremental workspace build... LocalRunLaunchDelegate.Launching_Local_C_Application=Launching Local C/C++ Application LocalRunLaunchDelegate.Failed_setting_runtime_option_though_debugger=Failed to set program arguments, environment or working directory. @@ -86,6 +89,15 @@ CMainTab.Use_Active=Use Active #For CMainTab.Configuration_name: {0} - project name; {1} - configuration name CMainTab.Configuration_name={0} {1} +CMainTab.Build_options=Build (if required) before launching +CMainTab.Disable_build_button_label=Disable auto build +CMainTab.Disable_build_button_tooltip=Requires manually building project before launching (this may improve launch performance) +CMainTab.Enable_build_button_label=Enable auto build +CMainTab.Enable_build_button_tooltip=Always build project before launching (this may impact launch performance) +CMainTab.Workspace_settings_button_label=Use workspace settings +CMainTab.Workspace_settings_button_tooltip=Use workspace settings +CMainTab.Workspace_settings_link_label=Configure Workspace Settings... +CMainTab.Workspace_settings_page_id=org.eclipse.debug.ui.LaunchingPreferencePage CDebuggerTab.Advanced_Options_Dialog_Title=Advanced Options CDebuggerTab.Stop_at_main_on_startup=Stop on startup at: diff -r bf8d63f38814 -r 89a4ce4b37f5 cdt/cdt_6_0_x/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CMainTab.java --- a/cdt/cdt_6_0_x/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CMainTab.java Thu Aug 06 12:03:24 2009 -0500 +++ b/cdt/cdt_6_0_x/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CMainTab.java Thu Aug 06 12:19:08 2009 -0500 @@ -66,9 +66,12 @@ import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.FileDialog; +import org.eclipse.swt.widgets.Group; import org.eclipse.swt.widgets.Label; +import org.eclipse.swt.widgets.Link; import org.eclipse.swt.widgets.Text; import org.eclipse.ui.dialogs.ElementListSelectionDialog; +import org.eclipse.ui.dialogs.PreferencesUtil; import org.eclipse.ui.dialogs.TwoPaneElementSelector; /** @@ -114,6 +117,11 @@ * @since 6.0 */ protected Combo fBuildConfigCombo; + // Build option UI widgets + protected Button fDisableBuildButton; + protected Button fEnableBuildButton; + protected Button fWorkspaceSettingsButton; + protected Link fWorkpsaceSettingsLink; private final boolean fWantsTerminalOption; protected Button fTerminalButton; @@ -164,6 +172,7 @@ createVerticalSpacer(comp, 1); createProjectGroup(comp, 1); createBuildConfigCombo(comp, 1); + createBuildOptionGroup(comp, 1); createExeFileGroup(comp, 1); createVerticalSpacer(comp, 1); if (fSpecifyCoreFile) { @@ -320,6 +329,65 @@ }); } + protected void createBuildOptionGroup(final Composite parent, int colSpan) { + Group buildGroup = new Group(parent, SWT.NONE); + GridData gridData = new GridData(GridData.FILL_HORIZONTAL); + gridData.horizontalSpan = colSpan; + GridLayout gridLayout = new GridLayout(); + gridLayout.numColumns = 2; + gridLayout.marginHeight = 5; + gridLayout.marginWidth = 5; + gridLayout.makeColumnsEqualWidth= true; + buildGroup.setLayoutData(gridData); + buildGroup.setLayout(gridLayout); + buildGroup.setText("Build (if required) before launching"); //$NON-NLS-1$ + + fDisableBuildButton = new Button(buildGroup, SWT.RADIO); + fDisableBuildButton.setText(LaunchMessages.getString("CMainTab.Disable_build_button_label")); //$NON-NLS-1$ + fDisableBuildButton.setToolTipText(LaunchMessages.getString("CMainTab.Disable_build_button_tooltip")); //$NON-NLS-1$ + fDisableBuildButton.addSelectionListener(new SelectionAdapter() { + + public void widgetSelected(SelectionEvent evt) { + updateLaunchConfigurationDialog(); + } + }); + + new Label(buildGroup, SWT.NONE); + + fEnableBuildButton = new Button(buildGroup, SWT.RADIO); + fEnableBuildButton.setText(LaunchMessages.getString("CMainTab.Enable_build_button_label")); //$NON-NLS-1$ + fEnableBuildButton.setToolTipText(LaunchMessages.getString("CMainTab.Enable_build_button_tooltip")); //$NON-NLS-1$ + fEnableBuildButton.addSelectionListener(new SelectionAdapter() { + + public void widgetSelected(SelectionEvent evt) { + updateLaunchConfigurationDialog(); + } + }); + + new Label(buildGroup, SWT.NONE); + + fWorkspaceSettingsButton = new Button(buildGroup, SWT.RADIO); + fWorkspaceSettingsButton.setText(LaunchMessages.getString("CMainTab.Workspace_settings_button_label")); //$NON-NLS-1$ + fWorkspaceSettingsButton.setToolTipText(LaunchMessages.getString("CMainTab.Workspace_settings_button_tooltip")); //$NON-NLS-1$ + fWorkspaceSettingsButton.addSelectionListener(new SelectionAdapter() { + + public void widgetSelected(SelectionEvent evt) { + updateLaunchConfigurationDialog(); + } + }); + + fWorkpsaceSettingsLink = new Link(buildGroup, SWT.NONE); //$NON-NLS-1$ + fWorkpsaceSettingsLink.setText(LaunchMessages.getString("CMainTab.Workspace_settings_link_label")); //$NON-NLS-1$ + fWorkpsaceSettingsLink.addSelectionListener(new SelectionAdapter() { + public void widgetSelected(SelectionEvent e) { + PreferencesUtil.createPreferenceDialogOn( + parent.getShell(), + LaunchMessages.getString("CMainTab.Workspace_settings_page_id"), //$NON-NLS-1$ + null, + null).open(); + } + }); + } /** @since 6.0 */ protected void createCoreFileGroup(Composite parent, int colSpan) { Composite coreComp = new Composite(parent, SWT.NONE); @@ -395,6 +463,7 @@ updateProjectFromConfig(config); updateProgramFromConfig(config); updateCoreFromConfig(config); + updateBuildOptionFromConfig(config); updateTerminalFromConfig(config); } @@ -424,13 +493,16 @@ } protected void updateProgramFromConfig(ILaunchConfiguration config) { - String programName = EMPTY_STRING; - try { - programName = config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, EMPTY_STRING); - } catch (CoreException ce) { - LaunchUIPlugin.log(ce); + if (fProgText != null) + { + String programName = EMPTY_STRING; + try { + programName = config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, EMPTY_STRING); + } catch (CoreException ce) { + LaunchUIPlugin.log(ce); + } + fProgText.setText(programName); } - fProgText.setText(programName); } /** @since 6.0 */ @@ -442,10 +514,23 @@ } catch (CoreException ce) { LaunchUIPlugin.log(ce); } - fCoreText.setText(coreName); + fProgText.setText(coreName); } } - + + protected void updateBuildOptionFromConfig(ILaunchConfiguration config) { + int buildBeforeLaunchValue = ICDTLaunchConfigurationConstants.BUILD_BEFORE_LAUNCH_USE_WORKSPACE_SETTING; + try { + buildBeforeLaunchValue = config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_BUILD_BEFORE_LAUNCH, buildBeforeLaunchValue); + } catch (CoreException e) { + LaunchUIPlugin.log(e); + } + + fDisableBuildButton.setSelection(buildBeforeLaunchValue == ICDTLaunchConfigurationConstants.BUILD_BEFORE_LAUNCH_DISABLED); + fEnableBuildButton.setSelection(buildBeforeLaunchValue == ICDTLaunchConfigurationConstants.BUILD_BEFORE_LAUNCH_ENABLED); + fWorkspaceSettingsButton.setSelection(buildBeforeLaunchValue == ICDTLaunchConfigurationConstants.BUILD_BEFORE_LAUNCH_USE_WORKSPACE_SETTING); + } + /* * (non-Javadoc) * @@ -464,14 +549,28 @@ config.setMappedResources(null); } config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROJECT_NAME, fProjText.getText()); - config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROJECT_BUILD_CONFIG_ID, (String)fBuildConfigCombo.getData(Integer.toString(fBuildConfigCombo.getSelectionIndex()))); - config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, fProgText.getText()); + if (fBuildConfigCombo != null) { + config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROJECT_BUILD_CONFIG_ID, (String)fBuildConfigCombo.getData(Integer.toString(fBuildConfigCombo.getSelectionIndex()))); + } + if (fProgText != null) { + config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, fProgText.getText()); + } if (fCoreText != null) { config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_COREFILE_PATH, fCoreText.getText()); } if (fTerminalButton != null) { config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_USE_TERMINAL, fTerminalButton.getSelection()); } + + if (fDisableBuildButton != null) { + int buildBeforeLaunchValue = ICDTLaunchConfigurationConstants.BUILD_BEFORE_LAUNCH_USE_WORKSPACE_SETTING; + if (fDisableBuildButton.getSelection()) { + buildBeforeLaunchValue = ICDTLaunchConfigurationConstants.BUILD_BEFORE_LAUNCH_DISABLED; + } else if (fEnableBuildButton.getSelection()) { + buildBeforeLaunchValue = ICDTLaunchConfigurationConstants.BUILD_BEFORE_LAUNCH_ENABLED; + } + config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_BUILD_BEFORE_LAUNCH, buildBeforeLaunchValue); + } } /** diff -r bf8d63f38814 -r 89a4ce4b37f5 foo.txt --- a/foo.txt Thu Aug 06 12:03:24 2009 -0500 +++ b/foo.txt Thu Aug 06 12:19:08 2009 -0500 @@ -1,557 +1,48 @@ # HG changeset patch -# User dadubrow -# Date 1243954767 18000 -# Node ID 06d88bb6aac0b30ae0bb2b46f620317d07b4c244 -# Parent 3ac8c55882b5055ce4206fab17cb2b5c01df9d9f -Add refresh logging to core resources plugin +# User ryall +# Date 1249412413 18000 +# Node ID fcb77f9783d2c410f5e70d8859fd004c67d10b0c +# Parent e82f98a34bed4d769138c63f4c80d8b603593126 +Fix NPEs. -diff -r 3ac8c55882b5 -r 06d88bb6aac0 platform/org.eclipse.core.resources/src/org/eclipse/core/internal/localstore/FileSystemResourceManager.java ---- a/platform/org.eclipse.core.resources/src/org/eclipse/core/internal/localstore/FileSystemResourceManager.java Mon Jun 01 19:29:06 2009 -0500 -+++ b/platform/org.eclipse.core.resources/src/org/eclipse/core/internal/localstore/FileSystemResourceManager.java Tue Jun 02 09:59:27 2009 -0500 -@@ -15,6 +15,7 @@ - import java.net.URI; - import java.util.*; - import org.eclipse.core.filesystem.*; -+import org.eclipse.core.internal.refresh.RefreshJob; - import org.eclipse.core.internal.resources.*; - import org.eclipse.core.internal.resources.File; - import org.eclipse.core.internal.utils.*; -@@ -731,6 +732,26 @@ - } - - public boolean refresh(IResource target, int depth, boolean updateAliases, IProgressMonitor monitor) throws CoreException { -+ long startTimeMs = System.currentTimeMillis(); -+ boolean result = refreshImpl(target, depth, updateAliases, monitor); -+ if (!RefreshJob.isRefreshing()) { -+ long totalMs = System.currentTimeMillis() - startTimeMs; -+ StringBuffer sb = new StringBuffer(); -+ sb.append("Refresh called on "); -+ sb.append(target.getFullPath()); -+ sb.append(" completed in : "); -+ sb.append(totalMs); -+ sb.append("ms"); -+ ResourcesPlugin.writeRefreshLog(sb.toString()); -+ StackTraceElement[] trace = Thread.currentThread().getStackTrace(); -+ for (int i = 2; i < trace.length; i++) { // skip the getStackTrace and dump calls -+ ResourcesPlugin.writeRefreshLog("\tat " + trace[i]); -+ } -+ } -+ return result; -+ } -+ -+ private boolean refreshImpl(IResource target, int depth, boolean updateAliases, IProgressMonitor monitor) throws CoreException { - switch (target.getType()) { - case IResource.ROOT : - return refreshRoot((IWorkspaceRoot) target, depth, updateAliases, monitor); -@@ -787,7 +808,7 @@ - // drop the depth by one level since processing the root counts as one level. - depth = depth == IResource.DEPTH_ONE ? IResource.DEPTH_ZERO : depth; - for (int i = 0; i < projects.length; i++) -- changed |= refresh(projects[i], depth, updateAliases, Policy.subMonitorFor(monitor, 1)); -+ changed |= refreshImpl(projects[i], depth, updateAliases, Policy.subMonitorFor(monitor, 1)); - return changed; - } finally { - monitor.done(); -diff -r 3ac8c55882b5 -r 06d88bb6aac0 platform/org.eclipse.core.resources/src/org/eclipse/core/internal/refresh/RefreshJob.java ---- a/platform/org.eclipse.core.resources/src/org/eclipse/core/internal/refresh/RefreshJob.java Mon Jun 01 19:29:06 2009 -0500 -+++ b/platform/org.eclipse.core.resources/src/org/eclipse/core/internal/refresh/RefreshJob.java Tue Jun 02 09:59:27 2009 -0500 -@@ -11,6 +11,7 @@ - package org.eclipse.core.internal.refresh; - - import java.util.*; -+ - import org.eclipse.core.internal.localstore.PrefixPool; - import org.eclipse.core.internal.utils.Messages; - import org.eclipse.core.internal.utils.Policy; -@@ -27,6 +28,13 @@ - */ - public class RefreshJob extends WorkspaceJob { - private static final long UPDATE_DELAY = 200; -+ -+ /** -+ * Flag indicating refreshing in progress if > 0 -+ */ -+ private static int refreshingLevel = 0; -+ -+ - /** - * List of refresh requests. Requests are processed in order from - * the end of the list. Requests can be added to either the beginning -@@ -151,6 +159,13 @@ - MultiStatus errors = new MultiStatus(ResourcesPlugin.PI_RESOURCES, 1, msg, null); - long longestRefresh = 0; - try { -+ refreshingLevel++; -+ ResourcesPlugin.writeRefreshLog(RefreshManager.DEBUG_PREFIX + " refreshing started..."); //$NON-NLS-1$ -+ for (Iterator iterator = fRequests.iterator(); iterator.hasNext();) { -+ IResource resource = (IResource) iterator.next(); -+ ResourcesPlugin.writeRefreshLog(RefreshManager.DEBUG_PREFIX + " requested resource to refresh: " + resource.getFullPath()); //$NON-NLS-1$ -+ } -+ - if (RefreshManager.DEBUG) - Policy.debug(RefreshManager.DEBUG_PREFIX + " starting refresh job"); //$NON-NLS-1$ - int refreshCount = 0; -@@ -193,6 +208,9 @@ - monitor.done(); - if (RefreshManager.DEBUG) - System.out.println(RefreshManager.DEBUG_PREFIX + " finished refresh job in: " + (System.currentTimeMillis() - start) + "ms"); //$NON-NLS-1$ //$NON-NLS-2$ -+ -+ ResourcesPlugin.writeRefreshLog(RefreshManager.DEBUG_PREFIX + " finished refresh job in: " + (System.currentTimeMillis() - start) + "ms"); //$NON-NLS-1$ //$NON-NLS-2$ -+ refreshingLevel--; - } - if (!errors.isOK()) - return errors; -@@ -222,4 +240,8 @@ - System.out.println(RefreshManager.DEBUG_PREFIX + " disabling auto-refresh"); //$NON-NLS-1$ - cancel(); - } -+ -+ public static boolean isRefreshing() { -+ return refreshingLevel > 0; -+ } - } -diff -r 3ac8c55882b5 -r 06d88bb6aac0 platform/org.eclipse.core.resources/src/org/eclipse/core/internal/utils/messages.properties ---- /dev/null Thu Jan 01 00:00:00 1970 +0000 -+++ b/platform/org.eclipse.core.resources/src/org/eclipse/core/internal/utils/messages.properties Tue Jun 02 09:59:27 2009 -0500 -@@ -0,0 +1,291 @@ -+############################################################################### -+# Copyright (c) 2000, 2008 IBM Corporation and others. -+# All rights reserved. This program and the accompanying materials -+# are made available under the terms of the Eclipse Public License v1.0 -+# which accompanies this distribution, and is available at -+# http://www.eclipse.org/legal/epl-v10.html -+# -+# Contributors: -+# IBM Corporation - initial API and implementation -+############################################################################### -+### Resources plugin messages. -+ -+### dtree -+dtree_immutable = Illegal attempt to modify an immutable tree. -+dtree_malformedTree = Malformed tree. -+dtree_missingChild = Missing child node: {0}. -+dtree_notFound = Tree element ''{0}'' not found. -+dtree_notImmutable = Tree must be immutable. -+dtree_reverse = Tried to reverse a non-comparison tree. -+dtree_subclassImplement = Subclass should have implemented this. -+dtree_switchError = Switch error in DeltaTreeReader.readNode(). -+ -+### events -+events_builderError = Errors running builder ''{0}'' on project ''{1}''. -+events_building_0 = Building workspace -+events_building_1 = Building ''{0}'' -+events_errors = Errors during build. -+events_instantiate_1 = Error instantiating builder ''{0}''. -+events_invoking_1 = Invoking builder on ''{0}''. -+events_invoking_2 = Invoking ''{0}'' on ''{1}''. -+events_skippingBuilder = Skipping builder ''{0}'' for project ''{1}''. Either the builder is missing from the install, or it belongs to a project nature that is missing or disabled. -+events_unknown = {0} encountered while running {1}. -+ -+history_copyToNull = Unable to copy local history to or from a null location. -+history_copyToSelf = Unable to copy local history to and from the same location. -+history_errorContentDescription = Error retrieving content description for local history for: ''{0}''. -+history_notValid = State is not valid or might have expired. -+history_problemsCleaning = Problems cleaning up history store. -+ -+links_creating = Creating link. -+links_errorLinkReconcile = Error processing changed links in project description file. -+links_invalidLocation = ''{0}'' is not a valid location for linked resources. -+links_localDoesNotExist = Cannot create linked resource. Local location ''{0}'' does not exist. -+links_locationOverlapsLink = ''{0}'' is not a valid location because the project contains a linked resource at that location. -+links_locationOverlapsProject = Cannot create a link to ''{0}'' because it overlaps the location of the project that contains the linked resource. -+links_natureVeto = Linking is not allowed because project nature ''{0}'' does not allow it. -+links_noPath = A Link location must be specified. -+links_overlappingResource = Location ''{0}'' may overlap another resource. This can cause unexpected side-effects. -+links_updatingDuplicate = Updating duplicate resource: ''{0}''. -+links_parentNotAccessible = Cannot create linked resource ''{0}''. The parent resource is not accessible. -+links_notFileFolder = Cannot create linked resource ''{0}''. Only files and folders can be linked. -+links_vetoNature = Cannot add nature because project ''{0}'' contains linked resources, and nature ''{1}'' does not allow it. -+links_workspaceVeto = Linked resources are not supported by this application. -+links_wrongLocalType = Cannot create linked resource ''{0}''. Files cannot be linked to folders. -+ -+### local store -+localstore_copying = Copying ''{0}''. -+localstore_copyProblem = Problems encountered while copying resources. -+localstore_couldnotDelete = Could not delete ''{0}''. -+localstore_couldNotMove = Could not move ''{0}''. -+localstore_couldNotRead = Could not read file ''{0}''. -+localstore_couldNotWrite = Could not write file ''{0}''. -+localstore_couldNotWriteReadOnly = Could not write to read-only file: ''{0}''. -+localstore_deleteProblem = Problems encountered while deleting resources. -+localstore_deleting = Deleting ''{0}''. -+localstore_failedReadDuringWrite = Could not read from source when writing file ''{0}'' -+localstore_fileExists = A resource already exists on disk ''{0}''. -+localstore_fileNotFound = File not found: {0}. -+localstore_locationUndefined = The location for ''{0}'' could not be determined because it is based on an undefined path variable. -+localstore_refreshing = Refreshing ''{0}''. -+localstore_refreshingRoot = Refreshing workspace. -+localstore_resourceExists = Resource already exists on disk: ''{0}''. -+localstore_resourceIsOutOfSync = Resource is out of sync with the file system: ''{0}''. -+ -+### Resource mappings and models -+mapping_invalidDef = Model provider extension found with invalid definition: {0}. -+mapping_wrongType = Model provider ''{0}'' does not extend ModelProvider. -+mapping_noIdentifier = Found model provider extension with no identifier; ignoring extension. -+mapping_validate = Validating resource changes -+mapping_multiProblems = Multiple potential side effects have been identified. -+ -+### internal.resources -+natures_duplicateNature = Duplicate nature: {0}. -+natures_hasCycle = Nature is invalid because its prerequisites form a cycle: {0} -+natures_missingIdentifier = Found nature extension with no identifier; ignoring extension. -+natures_missingNature = Nature does not exist: {0}. -+natures_missingPrerequisite = Nature {0} is missing prerequisite nature: {1}. -+natures_multipleSetMembers = Multiple natures found for nature set: {0}. -+natures_invalidDefinition = Nature extension found with invalid definition: {0}. -+natures_invalidRemoval = Cannot remove nature {0} because it is a prerequisite of nature {1}. -+natures_invalidSet = The set of natures is not valid. -+ -+pathvar_length = Path variable name must have a length > 0. -+pathvar_beginLetter = Path variable name must begin with a letter or underscore. -+pathvar_invalidChar = Path variable name cannot contain character: {0}. -+pathvar_invalidValue = Path variable value must be valid and absolute. -+pathvar_undefined = ''{0}'' is not a valid location. The location is relative to undefined workspace path variable ''{1}''. -+pathvar_whitespace= Path variable name cannot contain whitespace -+ -+### preferences -+preferences_deleteException=Exception deleting file: {0}. -+preferences_loadException=Exception loading preferences from: {0}. -+preferences_operationCanceled=Operation canceled. -+preferences_removeNodeException=Exception while removing preference node: {0}. -+preferences_clearNodeException=Exception while clearing preference node: {0}. -+preferences_saveProblems=Exception occurred while saving project preferences: {0}. -+preferences_syncException=Exception occurred while synchronizing node: {0}. -+ -+projRead_badLinkName = Names ''{0}'' and ''{1}'' detected for a single link. Using ''{0}''. -+projRead_badLinkType2 = Types ''{0}'' and ''{1}'' detected for a single link. Using ''{0}''. -+projRead_badLocation = Locations ''{0}'' and ''{1}'' detected for a single link. Using ''{0}''. -+projRead_emptyLinkName = Empty name detected for linked resource with type ''{0}'' and location ''{1}''. -+projRead_badLinkType = Illegal link type \"-1\" detected for linked resource with name ''{0}'' and location ''{1}''. -+projRead_badLinkLocation = Empty location detected for linked resource with name ''{0}'' and type ''{1}''. -+projRead_whichKey = Two values detected for an argument name in a build command: ''{0}'' and ''{1}''. Using ''{0}''. -+projRead_whichValue = Two values detected for an argument value in a build command: ''{0}'' and ''{1}''. Using ''{0}''. -+projRead_notProjectDescription = Encountered element name ''{0}'' instead of \"project\" when trying to read a project description file. -+projRead_failureReadingProjectDesc = Failure occurred reading .project file. -+ -+properties_qualifierIsNull = Qualifier part of property key cannot be null. -+properties_readProperties = Failure while reading persistent properties for resource ''{0}'', file was corrupt. Some properties may have been lost. -+properties_valueTooLong = Could not set property: {0} {1}. Value is too long. -+properties_couldNotClose = Could not close property store for: {0}. -+ -+### auto-refresh -+refresh_jobName = Refreshing workspace -+refresh_task = Resources to refresh: {0} -+refresh_pollJob = Searching for local changes -+refresh_refreshErr = Problems occurred while refreshing local changes -+refresh_installError = An error occurred while installing an auto-refresh monitor -+ -+resources_cannotModify = The resource tree is locked for modifications. -+resources_changeInAdd = Trying to change a marker in an add method. -+resources_charsetBroadcasting = Reporting encoding changes. -+resources_charsetUpdating = Updating encoding settings. -+resources_closing_0 = Closing workspace. -+resources_closing_1 = Closing ''{0}''. -+resources_copyDestNotSub = Cannot copy ''{0}''. Destination should not be under source''s hierarchy. -+resources_copying = Copying ''{0}''. -+resources_copying_0 = Copying. -+resources_copyNotMet = Copy requirements not met. -+resources_copyProblem = Problems encountered while copying resources. -+resources_couldnotDelete = Could not delete ''{0}''. -+resources_create = Create. -+resources_creating = Creating resource ''{0}''. -+resources_deleteMeta = Could not delete metadata for ''{0}''. -+resources_deleteProblem = Problems encountered while deleting resources. -+resources_deleting = Deleting ''{0}''. -+resources_deleting_0 = Deleting. -+resources_destNotNull = Destination path should not be null. -+resources_errorContentDescription = Error retrieving content description for resource ''{0}''. -+resources_errorDeleting = Error deleting resource ''{0}'' from the workspace tree. -+resources_errorMarkersDelete = Error deleting markers for resource ''{0}''. -+resources_errorMarkersMove = Error moving markers from resource ''{0}'' to ''{1}''. -+resources_errorMembers = Error retrieving members of container ''{0}''. -+resources_errorMoving = Error moving resource ''{0}'' to ''{1}'' in the workspace tree. -+resources_errorNature = Error configuring nature ''{0}''. -+resources_errorPropertiesMove = Error moving properties for resource ''{0}'' to ''{1}''. -+resources_errorRefresh = Errors occurred during refresh of resource ''{0}''. -+resources_errorReadProject = Failed to read project description file from location ''{0}''. -+resources_errorMultiRefresh = Errors occurred while refreshing resources with the local file system. -+resources_errorValidator = Exception running validator code. -+resources_errorVisiting = An error occurred while traversing resources. -+resources_existsDifferentCase = A resource exists with a different case: ''{0}''. -+resources_existsLocalDifferentCase = A resource exists on disk with a different case: ''{0}''. -+resources_exMasterTable = Could not read master table. -+resources_exReadProjectLocation = Could not read the project location for ''{0}''. -+resources_exSafeRead = Could not read safe table. -+resources_exSafeSave = Could not save safe table. -+resources_exSaveMaster = Could not save master table. -+resources_exSaveProjectLocation = Could not save the project location for ''{0}''. -+resources_fileExists = A resource already exists on disk ''{0}''. -+resources_fileToProj = Cannot copy a file to a project. -+resources_flushingContentDescriptionCache = Flushing content description cache. -+resources_folderOverFile = Cannot overwrite folder with file ''{0}''. -+resources_format = Incompatible file format. Workspace was saved with an incompatible version: {0}. -+resources_initValidator = Unable to instantiate validator. -+resources_initHook = Unable to instantiate move/delete hook. -+resources_initTeamHook = Unable to instantiate team hook. -+resources_invalidCharInName = {0} is an invalid character in resource name ''{1}''. -+resources_invalidCharInPath = {0} is an invalid character in path ''{1}''. -+resources_invalidName = ''{0}'' is an invalid name on this platform. -+resources_invalidPath = ''{0}'' is an invalid resource path. -+resources_invalidProjDesc = Invalid project description. -+resources_invalidResourceName = ''{0}'' is an invalid resource name. -+resources_invalidRoot = Root (/) is an invalid resource path. -+resources_markerNotFound = Marker id {0} not found. -+resources_missingProjectMeta = The project description file (.project) for ''{0}'' is missing. This file contains important information about the project. The project will not function properly until this file is restored. -+resources_missingProjectMetaRepaired = The project description file (.project) for ''{0}'' was missing. This file contains important information about the project. A new project description file has been created, but some information about the project may have been lost. -+resources_moveDestNotSub = Cannot move ''{0}''. Destination should not be under source''s hierarchy. -+resources_moveMeta = Error moving metadata area from {0} to {1}. -+resources_moveNotMet = Move requirements not met. -+resources_moveNotProject = Cannot move ''{0}'' to ''{1}''. Source must be a project. -+resources_moveProblem = Problems encountered while moving resources. -+resources_moveRoot = Cannot move the workspace root. -+resources_moving = Moving ''{0}''. -+resources_moving_0 = Moving. -+resources_mustBeAbsolute = Path ''{0}'' must be absolute. -+resources_mustBeLocal = Resource ''{0}'' is not local. -+resources_mustBeOpen = Resource ''{0}'' is not open. -+resources_mustExist = Resource ''{0}'' does not exist. -+resources_mustNotExist = Resource ''{0}'' already exists. -+resources_nameEmpty = Names cannot be empty. -+resources_nameNull = Name must not be null. -+resources_natureClass = Missing project nature class for ''{0}''. -+resources_natureDeconfig = Error deconfiguring nature: {0}. -+resources_natureExtension = Missing project nature extension for {0}. -+resources_natureFormat = Project nature {0} does not specify a runtime attribute. -+resources_natureImplement = Project nature {0} does not implement IProjectNature. -+resources_notChild = Resource ''{0}'' is not a child of ''{1}''. -+resources_oneValidator = There must be exactly 0 or 1 validator extensions defined in the fileModificationValidator extension point. -+resources_oneHook = There must be exactly 0 or 1 hook extensions defined in the moveDeleteHook extension point. -+resources_oneTeamHook = There must be exactly 0 or 1 hook extensions defined in the teamHook extension point. -+resources_opening_1 = Opening ''{0}''. -+resources_overlapWorkspace = {0} overlaps the workspace location: {1} -+resources_overlapProject = {0} overlaps the location of another project: ''{1}'' -+resources_pathNull = Paths must not be null. -+resources_projectDesc = Problems encountered while setting project description. -+resources_projectDescSync = Could not set the project description for ''{0}'' because the project description file (.project) is out of sync with the file system. -+resources_projectPath = Path for project must have only one segment. -+resources_reading = Reading. -+resources_readingSnap = Reading snapshot. -+resources_readingEncoding = Could not read encoding settings. -+resources_readMarkers = Failure while reading markers, the marker file was corrupt. Some markers may be lost. -+resources_readMeta = Could not read metadata for ''{0}''. -+resources_readMetaWrongVersion = Could not read metadata for ''{0}''. Unexpected version: {1}. -+resources_readOnly = Resource ''{0}'' is read-only. -+resources_readOnly2 = Cannot edit read-only resources. -+resources_readProjectMeta = Failed to read the project description file (.project) for ''{0}''. The file has been changed on disk, and it now contains invalid information. The project will not function properly until the description file is restored to a valid state. -+resources_readProjectTree = Problems reading project tree. -+resources_readSync = Errors reading sync info file: {0}. -+resources_readWorkspaceMeta = Could not read workspace metadata. -+resources_readWorkspaceMetaValue = Invalid attribute value in workspace metadata: {0}. Value will be ignored. -+resources_readWorkspaceSnap = Problems reading workspace tree snapshot. -+resources_readWorkspaceTree = Problems reading workspace tree. -+resources_refreshing = Refreshing ''{0}''. -+resources_refreshingRoot = Refreshing workspace. -+resources_resetMarkers = Could not reset markers snapshot file. -+resources_resetSync = Could not reset sync info snapshot file. -+resources_resourcePath = Invalid path for resource ''{0}''. Must include project and resource name. -+resources_saveOp = Save cannot be called from inside an operation. -+resources_saveProblem = Problems occurred during save. -+resources_saveWarnings = Save operation warnings. -+resources_saving_0 = Saving workspace. -+resources_savingEncoding = Could not save encoding settings. -+resources_setDesc = Setting project description. -+resources_setLocal = Setting resource local flag. -+resources_settingCharset = Setting character set for resource ''{0}''. -+resources_settingDefaultCharsetContainer = Setting default character set for resource ''{0}''. -+resources_settingContents = Setting contents for ''{0}''. -+resources_shutdown = Workspace was not properly initialized or has already shutdown. -+resources_shutdownProblems = Problem on shutdown. -+resources_snapInit = Could not initialize snapshot file. -+resources_snapRead = Could not read snapshot file. -+resources_snapRequest = Snapshot requested. -+resources_snapshot = Periodic workspace save. -+resources_startupProblems = Workspace restored, but some problems occurred. -+resources_touch = Touching resource ''{0}''. -+resources_updating = Updating workspace -+resources_updatingEncoding = Problems encountered while updating encoding settings. -+resources_workspaceClosed = Workspace is closed. -+resources_workspaceOpen = The workspace is already open. -+resources_writeMeta = Could not write metadata for ''{0}''. -+resources_writeWorkspaceMeta = Could not write workspace metadata ''{0}''. -+ -+synchronizer_partnerNotRegistered = Sync partner: {0} not registered with the synchronizer. -+ -+### URL -+url_badVariant = Unsupported \"platform:\" protocol variation {0}. -+url_couldNotResolve = Project ''{0}'' does not exist. Could not resolve URL: {1}. -+ -+### utils -+utils_clone = Clone not supported. -+utils_stringJobName = Compacting memory -+ -+### watson -+watson_elementNotFound = Element not found: {0}. -+watson_illegalSubtree = Illegal subtree passed to createSubtree(). -+watson_immutable = Attempt to modify an immutable tree. -+watson_noModify = Cannot modify implicit root node. -+watson_nullArg = Null argument to {0}. -+watson_unknown = Unknown format. -+ -+### auto-refresh win32 native -+WM_beginTask = finding out of sync resources -+WM_jobName = Win32 refresh daemon -+WM_errors = Problems occurred refreshing resources -+WM_nativeErr = Problem occurred in auto-refresh native code: {0}. -+WM_errCloseHandle = Problem closing native refresh handle: {0}. -+WM_errCreateHandle = Problem creating handle for {0}, code: {0}. -+WM_errFindChange = Problem finding next change, code: {0} -diff -r 3ac8c55882b5 -r 06d88bb6aac0 platform/org.eclipse.core.resources/src/org/eclipse/core/resources/DiagnosticLog.java ---- /dev/null Thu Jan 01 00:00:00 1970 +0000 -+++ b/platform/org.eclipse.core.resources/src/org/eclipse/core/resources/DiagnosticLog.java Tue Jun 02 09:59:27 2009 -0500 -@@ -0,0 +1,95 @@ -+/* -+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -+* All rights reserved. -+* This component and the accompanying materials are made available -+* under the terms of the License "Eclipse Public License v1.0" -+* which accompanies this distribution, and is available -+* at the URL "http://www.eclipse.org/legal/epl-v10.html". -+* -+* Initial Contributors: -+* Nokia Corporation - initial contribution. -+* -+* Contributors: -+* -+* Description: -+* -+*/ -+package org.eclipse.core.resources; -+ -+import java.io.File; -+import java.io.IOException; -+import java.util.logging.FileHandler; -+import java.util.logging.Handler; -+import java.util.logging.Level; -+import java.util.logging.LogRecord; -+import java.util.logging.Logger; -+ -+public class DiagnosticLog { -+ private String name; -+ private String id; -+ private Logger logger; -+ private File file; -+ -+ private class LogHandler extends Handler { -+ -+ FileHandler fileHandler; -+ File file; -+ -+ public LogHandler(File file) { -+ this.file = file; +diff -r e82f98a34bed -r fcb77f9783d2 cdt/cdt_6_0_x/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CMainTab.java +--- a/cdt/cdt_6_0_x/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CMainTab.java Tue Aug 04 13:42:53 2009 -0500 ++++ b/cdt/cdt_6_0_x/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CMainTab.java Tue Aug 04 14:00:13 2009 -0500 +@@ -493,13 +493,16 @@ + } + + protected void updateProgramFromConfig(ILaunchConfiguration config) { +- String programName = EMPTY_STRING; +- try { +- programName = config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, EMPTY_STRING); +- } catch (CoreException ce) { +- LaunchUIPlugin.log(ce); ++ if (fProgText != null) ++ { ++ String programName = EMPTY_STRING; ++ try { ++ programName = config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, EMPTY_STRING); ++ } catch (CoreException ce) { ++ LaunchUIPlugin.log(ce); ++ } ++ fProgText.setText(programName); + } +- fProgText.setText(programName); + } + + /** @since 6.0 */ +@@ -546,8 +549,12 @@ + config.setMappedResources(null); + } + config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROJECT_NAME, fProjText.getText()); +- config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROJECT_BUILD_CONFIG_ID, (String)fBuildConfigCombo.getData(Integer.toString(fBuildConfigCombo.getSelectionIndex()))); +- config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, fProgText.getText()); ++ if (fBuildConfigCombo != null) { ++ config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROJECT_BUILD_CONFIG_ID, (String)fBuildConfigCombo.getData(Integer.toString(fBuildConfigCombo.getSelectionIndex()))); + } -+ -+ public void close() throws SecurityException { -+ if (fileHandler != null) -+ fileHandler.close(); -+ } -+ -+ public void flush() { -+ if (fileHandler != null) -+ fileHandler.flush(); -+ } -+ -+ public void publish(LogRecord record) { -+ if (fileHandler == null) -+ { -+ try { -+ fileHandler= new FileHandler(file.getAbsolutePath()); -+ } catch (SecurityException e) { -+ e.printStackTrace(); -+ } catch (IOException e) { -+ e.printStackTrace(); -+ } -+ } -+ if (fileHandler != null) -+ fileHandler.publish(record); ++ if (fProgText != null) { ++ config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, fProgText.getText()); + } -+ -+ } -+ -+ public DiagnosticLog(String name, String id, String logFilePath) { -+ this.name = name; -+ this.id = id; -+ this.logger = Logger.getLogger(id); -+ logger.setLevel(Level.OFF); -+ logger.setUseParentHandlers(false); -+ this.file = new File(logFilePath); -+ logger.addHandler(new LogHandler(file)); -+ } -+ -+ public String getName() { -+ return name; -+ } -+ -+ public String getId() { -+ return id; -+ } -+ -+ public File getFile() { -+ return file; -+ } -+ -+ public Logger getLogger() { -+ return logger; -+ } -+ -+} -\ No newline at end of file -diff -r 3ac8c55882b5 -r 06d88bb6aac0 platform/org.eclipse.core.resources/src/org/eclipse/core/resources/ResourcesPlugin.java ---- a/platform/org.eclipse.core.resources/src/org/eclipse/core/resources/ResourcesPlugin.java Mon Jun 01 19:29:06 2009 -0500 -+++ b/platform/org.eclipse.core.resources/src/org/eclipse/core/resources/ResourcesPlugin.java Tue Jun 02 09:59:27 2009 -0500 -@@ -18,6 +18,8 @@ - import org.osgi.framework.BundleActivator; - import org.osgi.framework.BundleContext; - -+import java.util.logging.Level; -+ - /** - * The plug-in runtime class for the Resources plug-in. This is - * the starting point for all workspace and resource manipulation. -@@ -29,6 +31,7 @@ - * @noinstantiate This class is not intended to be instantiated by clients. - */ - public final class ResourcesPlugin extends Plugin { -+ - /** - * Unique identifier constant (value "org.eclipse.core.resources") - * for the standard Resources plug-in. -@@ -267,6 +270,10 @@ - */ - private static Workspace workspace = null; - -+ -+ private static final String REFRESH_LOG_ID = ".refresh.log"; -+ private DiagnosticLog refreshLog; -+ - /** - * Constructs an instance of this plug-in runtime class. - *

-@@ -377,4 +384,18 @@ - if (!result.isOK()) - getLog().log(result); - } -+ -+ public static void writeRefreshLog(String s) { -+ if (!plugin.getPluginPreferences().getBoolean(PI_RESOURCES + REFRESH_LOG_ID)) -+ return; -+ -+ if (plugin.refreshLog == null) { -+ IPath path = getWorkspace().getRoot().getLocation().append("refresh.log"); -+ plugin.refreshLog = new DiagnosticLog("refresh.log", PI_RESOURCES + REFRESH_LOG_ID, path.toOSString()); -+ plugin.refreshLog.getLogger().setLevel(Level.INFO); -+ } -+ -+ plugin.refreshLog.getLogger().info(s); -+ System.out.println(s); -+ } - } + if (fCoreText != null) { + config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_COREFILE_PATH, fCoreText.getText()); + }