1 # HG changeset patch |
1 # HG changeset patch |
2 # User dadubrow |
2 # User ryall |
3 # Date 1243954767 18000 |
3 # Date 1249412413 18000 |
4 # Node ID 06d88bb6aac0b30ae0bb2b46f620317d07b4c244 |
4 # Node ID fcb77f9783d2c410f5e70d8859fd004c67d10b0c |
5 # Parent 3ac8c55882b5055ce4206fab17cb2b5c01df9d9f |
5 # Parent e82f98a34bed4d769138c63f4c80d8b603593126 |
6 Add refresh logging to core resources plugin |
6 Fix NPEs. |
7 |
7 |
8 diff -r 3ac8c55882b5 -r 06d88bb6aac0 platform/org.eclipse.core.resources/src/org/eclipse/core/internal/localstore/FileSystemResourceManager.java |
8 diff -r e82f98a34bed -r fcb77f9783d2 cdt/cdt_6_0_x/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CMainTab.java |
9 --- a/platform/org.eclipse.core.resources/src/org/eclipse/core/internal/localstore/FileSystemResourceManager.java Mon Jun 01 19:29:06 2009 -0500 |
9 --- 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 |
10 +++ b/platform/org.eclipse.core.resources/src/org/eclipse/core/internal/localstore/FileSystemResourceManager.java Tue Jun 02 09:59:27 2009 -0500 |
10 +++ 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 |
11 @@ -15,6 +15,7 @@ |
11 @@ -493,13 +493,16 @@ |
12 import java.net.URI; |
|
13 import java.util.*; |
|
14 import org.eclipse.core.filesystem.*; |
|
15 +import org.eclipse.core.internal.refresh.RefreshJob; |
|
16 import org.eclipse.core.internal.resources.*; |
|
17 import org.eclipse.core.internal.resources.File; |
|
18 import org.eclipse.core.internal.utils.*; |
|
19 @@ -731,6 +732,26 @@ |
|
20 } |
12 } |
21 |
13 |
22 public boolean refresh(IResource target, int depth, boolean updateAliases, IProgressMonitor monitor) throws CoreException { |
14 protected void updateProgramFromConfig(ILaunchConfiguration config) { |
23 + long startTimeMs = System.currentTimeMillis(); |
15 - String programName = EMPTY_STRING; |
24 + boolean result = refreshImpl(target, depth, updateAliases, monitor); |
16 - try { |
25 + if (!RefreshJob.isRefreshing()) { |
17 - programName = config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, EMPTY_STRING); |
26 + long totalMs = System.currentTimeMillis() - startTimeMs; |
18 - } catch (CoreException ce) { |
27 + StringBuffer sb = new StringBuffer(); |
19 - LaunchUIPlugin.log(ce); |
28 + sb.append("Refresh called on "); |
20 + if (fProgText != null) |
29 + sb.append(target.getFullPath()); |
21 + { |
30 + sb.append(" completed in : "); |
22 + String programName = EMPTY_STRING; |
31 + sb.append(totalMs); |
23 + try { |
32 + sb.append("ms"); |
24 + programName = config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, EMPTY_STRING); |
33 + ResourcesPlugin.writeRefreshLog(sb.toString()); |
25 + } catch (CoreException ce) { |
34 + StackTraceElement[] trace = Thread.currentThread().getStackTrace(); |
26 + LaunchUIPlugin.log(ce); |
35 + for (int i = 2; i < trace.length; i++) { // skip the getStackTrace and dump calls |
|
36 + ResourcesPlugin.writeRefreshLog("\tat " + trace[i]); |
|
37 + } |
27 + } |
|
28 + fProgText.setText(programName); |
|
29 } |
|
30 - fProgText.setText(programName); |
|
31 } |
|
32 |
|
33 /** @since 6.0 */ |
|
34 @@ -546,8 +549,12 @@ |
|
35 config.setMappedResources(null); |
|
36 } |
|
37 config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROJECT_NAME, fProjText.getText()); |
|
38 - config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROJECT_BUILD_CONFIG_ID, (String)fBuildConfigCombo.getData(Integer.toString(fBuildConfigCombo.getSelectionIndex()))); |
|
39 - config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, fProgText.getText()); |
|
40 + if (fBuildConfigCombo != null) { |
|
41 + config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROJECT_BUILD_CONFIG_ID, (String)fBuildConfigCombo.getData(Integer.toString(fBuildConfigCombo.getSelectionIndex()))); |
38 + } |
42 + } |
39 + return result; |
43 + if (fProgText != null) { |
40 + } |
44 + config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, fProgText.getText()); |
41 + |
45 + } |
42 + private boolean refreshImpl(IResource target, int depth, boolean updateAliases, IProgressMonitor monitor) throws CoreException { |
46 if (fCoreText != null) { |
43 switch (target.getType()) { |
47 config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_COREFILE_PATH, fCoreText.getText()); |
44 case IResource.ROOT : |
|
45 return refreshRoot((IWorkspaceRoot) target, depth, updateAliases, monitor); |
|
46 @@ -787,7 +808,7 @@ |
|
47 // drop the depth by one level since processing the root counts as one level. |
|
48 depth = depth == IResource.DEPTH_ONE ? IResource.DEPTH_ZERO : depth; |
|
49 for (int i = 0; i < projects.length; i++) |
|
50 - changed |= refresh(projects[i], depth, updateAliases, Policy.subMonitorFor(monitor, 1)); |
|
51 + changed |= refreshImpl(projects[i], depth, updateAliases, Policy.subMonitorFor(monitor, 1)); |
|
52 return changed; |
|
53 } finally { |
|
54 monitor.done(); |
|
55 diff -r 3ac8c55882b5 -r 06d88bb6aac0 platform/org.eclipse.core.resources/src/org/eclipse/core/internal/refresh/RefreshJob.java |
|
56 --- a/platform/org.eclipse.core.resources/src/org/eclipse/core/internal/refresh/RefreshJob.java Mon Jun 01 19:29:06 2009 -0500 |
|
57 +++ b/platform/org.eclipse.core.resources/src/org/eclipse/core/internal/refresh/RefreshJob.java Tue Jun 02 09:59:27 2009 -0500 |
|
58 @@ -11,6 +11,7 @@ |
|
59 package org.eclipse.core.internal.refresh; |
|
60 |
|
61 import java.util.*; |
|
62 + |
|
63 import org.eclipse.core.internal.localstore.PrefixPool; |
|
64 import org.eclipse.core.internal.utils.Messages; |
|
65 import org.eclipse.core.internal.utils.Policy; |
|
66 @@ -27,6 +28,13 @@ |
|
67 */ |
|
68 public class RefreshJob extends WorkspaceJob { |
|
69 private static final long UPDATE_DELAY = 200; |
|
70 + |
|
71 + /** |
|
72 + * Flag indicating refreshing in progress if > 0 |
|
73 + */ |
|
74 + private static int refreshingLevel = 0; |
|
75 + |
|
76 + |
|
77 /** |
|
78 * List of refresh requests. Requests are processed in order from |
|
79 * the end of the list. Requests can be added to either the beginning |
|
80 @@ -151,6 +159,13 @@ |
|
81 MultiStatus errors = new MultiStatus(ResourcesPlugin.PI_RESOURCES, 1, msg, null); |
|
82 long longestRefresh = 0; |
|
83 try { |
|
84 + refreshingLevel++; |
|
85 + ResourcesPlugin.writeRefreshLog(RefreshManager.DEBUG_PREFIX + " refreshing started..."); //$NON-NLS-1$ |
|
86 + for (Iterator iterator = fRequests.iterator(); iterator.hasNext();) { |
|
87 + IResource resource = (IResource) iterator.next(); |
|
88 + ResourcesPlugin.writeRefreshLog(RefreshManager.DEBUG_PREFIX + " requested resource to refresh: " + resource.getFullPath()); //$NON-NLS-1$ |
|
89 + } |
|
90 + |
|
91 if (RefreshManager.DEBUG) |
|
92 Policy.debug(RefreshManager.DEBUG_PREFIX + " starting refresh job"); //$NON-NLS-1$ |
|
93 int refreshCount = 0; |
|
94 @@ -193,6 +208,9 @@ |
|
95 monitor.done(); |
|
96 if (RefreshManager.DEBUG) |
|
97 System.out.println(RefreshManager.DEBUG_PREFIX + " finished refresh job in: " + (System.currentTimeMillis() - start) + "ms"); //$NON-NLS-1$ //$NON-NLS-2$ |
|
98 + |
|
99 + ResourcesPlugin.writeRefreshLog(RefreshManager.DEBUG_PREFIX + " finished refresh job in: " + (System.currentTimeMillis() - start) + "ms"); //$NON-NLS-1$ //$NON-NLS-2$ |
|
100 + refreshingLevel--; |
|
101 } |
48 } |
102 if (!errors.isOK()) |
|
103 return errors; |
|
104 @@ -222,4 +240,8 @@ |
|
105 System.out.println(RefreshManager.DEBUG_PREFIX + " disabling auto-refresh"); //$NON-NLS-1$ |
|
106 cancel(); |
|
107 } |
|
108 + |
|
109 + public static boolean isRefreshing() { |
|
110 + return refreshingLevel > 0; |
|
111 + } |
|
112 } |
|
113 diff -r 3ac8c55882b5 -r 06d88bb6aac0 platform/org.eclipse.core.resources/src/org/eclipse/core/internal/utils/messages.properties |
|
114 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
|
115 +++ b/platform/org.eclipse.core.resources/src/org/eclipse/core/internal/utils/messages.properties Tue Jun 02 09:59:27 2009 -0500 |
|
116 @@ -0,0 +1,291 @@ |
|
117 +############################################################################### |
|
118 +# Copyright (c) 2000, 2008 IBM Corporation and others. |
|
119 +# All rights reserved. This program and the accompanying materials |
|
120 +# are made available under the terms of the Eclipse Public License v1.0 |
|
121 +# which accompanies this distribution, and is available at |
|
122 +# http://www.eclipse.org/legal/epl-v10.html |
|
123 +# |
|
124 +# Contributors: |
|
125 +# IBM Corporation - initial API and implementation |
|
126 +############################################################################### |
|
127 +### Resources plugin messages. |
|
128 + |
|
129 +### dtree |
|
130 +dtree_immutable = Illegal attempt to modify an immutable tree. |
|
131 +dtree_malformedTree = Malformed tree. |
|
132 +dtree_missingChild = Missing child node: {0}. |
|
133 +dtree_notFound = Tree element ''{0}'' not found. |
|
134 +dtree_notImmutable = Tree must be immutable. |
|
135 +dtree_reverse = Tried to reverse a non-comparison tree. |
|
136 +dtree_subclassImplement = Subclass should have implemented this. |
|
137 +dtree_switchError = Switch error in DeltaTreeReader.readNode(). |
|
138 + |
|
139 +### events |
|
140 +events_builderError = Errors running builder ''{0}'' on project ''{1}''. |
|
141 +events_building_0 = Building workspace |
|
142 +events_building_1 = Building ''{0}'' |
|
143 +events_errors = Errors during build. |
|
144 +events_instantiate_1 = Error instantiating builder ''{0}''. |
|
145 +events_invoking_1 = Invoking builder on ''{0}''. |
|
146 +events_invoking_2 = Invoking ''{0}'' on ''{1}''. |
|
147 +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. |
|
148 +events_unknown = {0} encountered while running {1}. |
|
149 + |
|
150 +history_copyToNull = Unable to copy local history to or from a null location. |
|
151 +history_copyToSelf = Unable to copy local history to and from the same location. |
|
152 +history_errorContentDescription = Error retrieving content description for local history for: ''{0}''. |
|
153 +history_notValid = State is not valid or might have expired. |
|
154 +history_problemsCleaning = Problems cleaning up history store. |
|
155 + |
|
156 +links_creating = Creating link. |
|
157 +links_errorLinkReconcile = Error processing changed links in project description file. |
|
158 +links_invalidLocation = ''{0}'' is not a valid location for linked resources. |
|
159 +links_localDoesNotExist = Cannot create linked resource. Local location ''{0}'' does not exist. |
|
160 +links_locationOverlapsLink = ''{0}'' is not a valid location because the project contains a linked resource at that location. |
|
161 +links_locationOverlapsProject = Cannot create a link to ''{0}'' because it overlaps the location of the project that contains the linked resource. |
|
162 +links_natureVeto = Linking is not allowed because project nature ''{0}'' does not allow it. |
|
163 +links_noPath = A Link location must be specified. |
|
164 +links_overlappingResource = Location ''{0}'' may overlap another resource. This can cause unexpected side-effects. |
|
165 +links_updatingDuplicate = Updating duplicate resource: ''{0}''. |
|
166 +links_parentNotAccessible = Cannot create linked resource ''{0}''. The parent resource is not accessible. |
|
167 +links_notFileFolder = Cannot create linked resource ''{0}''. Only files and folders can be linked. |
|
168 +links_vetoNature = Cannot add nature because project ''{0}'' contains linked resources, and nature ''{1}'' does not allow it. |
|
169 +links_workspaceVeto = Linked resources are not supported by this application. |
|
170 +links_wrongLocalType = Cannot create linked resource ''{0}''. Files cannot be linked to folders. |
|
171 + |
|
172 +### local store |
|
173 +localstore_copying = Copying ''{0}''. |
|
174 +localstore_copyProblem = Problems encountered while copying resources. |
|
175 +localstore_couldnotDelete = Could not delete ''{0}''. |
|
176 +localstore_couldNotMove = Could not move ''{0}''. |
|
177 +localstore_couldNotRead = Could not read file ''{0}''. |
|
178 +localstore_couldNotWrite = Could not write file ''{0}''. |
|
179 +localstore_couldNotWriteReadOnly = Could not write to read-only file: ''{0}''. |
|
180 +localstore_deleteProblem = Problems encountered while deleting resources. |
|
181 +localstore_deleting = Deleting ''{0}''. |
|
182 +localstore_failedReadDuringWrite = Could not read from source when writing file ''{0}'' |
|
183 +localstore_fileExists = A resource already exists on disk ''{0}''. |
|
184 +localstore_fileNotFound = File not found: {0}. |
|
185 +localstore_locationUndefined = The location for ''{0}'' could not be determined because it is based on an undefined path variable. |
|
186 +localstore_refreshing = Refreshing ''{0}''. |
|
187 +localstore_refreshingRoot = Refreshing workspace. |
|
188 +localstore_resourceExists = Resource already exists on disk: ''{0}''. |
|
189 +localstore_resourceIsOutOfSync = Resource is out of sync with the file system: ''{0}''. |
|
190 + |
|
191 +### Resource mappings and models |
|
192 +mapping_invalidDef = Model provider extension found with invalid definition: {0}. |
|
193 +mapping_wrongType = Model provider ''{0}'' does not extend ModelProvider. |
|
194 +mapping_noIdentifier = Found model provider extension with no identifier; ignoring extension. |
|
195 +mapping_validate = Validating resource changes |
|
196 +mapping_multiProblems = Multiple potential side effects have been identified. |
|
197 + |
|
198 +### internal.resources |
|
199 +natures_duplicateNature = Duplicate nature: {0}. |
|
200 +natures_hasCycle = Nature is invalid because its prerequisites form a cycle: {0} |
|
201 +natures_missingIdentifier = Found nature extension with no identifier; ignoring extension. |
|
202 +natures_missingNature = Nature does not exist: {0}. |
|
203 +natures_missingPrerequisite = Nature {0} is missing prerequisite nature: {1}. |
|
204 +natures_multipleSetMembers = Multiple natures found for nature set: {0}. |
|
205 +natures_invalidDefinition = Nature extension found with invalid definition: {0}. |
|
206 +natures_invalidRemoval = Cannot remove nature {0} because it is a prerequisite of nature {1}. |
|
207 +natures_invalidSet = The set of natures is not valid. |
|
208 + |
|
209 +pathvar_length = Path variable name must have a length > 0. |
|
210 +pathvar_beginLetter = Path variable name must begin with a letter or underscore. |
|
211 +pathvar_invalidChar = Path variable name cannot contain character: {0}. |
|
212 +pathvar_invalidValue = Path variable value must be valid and absolute. |
|
213 +pathvar_undefined = ''{0}'' is not a valid location. The location is relative to undefined workspace path variable ''{1}''. |
|
214 +pathvar_whitespace= Path variable name cannot contain whitespace |
|
215 + |
|
216 +### preferences |
|
217 +preferences_deleteException=Exception deleting file: {0}. |
|
218 +preferences_loadException=Exception loading preferences from: {0}. |
|
219 +preferences_operationCanceled=Operation canceled. |
|
220 +preferences_removeNodeException=Exception while removing preference node: {0}. |
|
221 +preferences_clearNodeException=Exception while clearing preference node: {0}. |
|
222 +preferences_saveProblems=Exception occurred while saving project preferences: {0}. |
|
223 +preferences_syncException=Exception occurred while synchronizing node: {0}. |
|
224 + |
|
225 +projRead_badLinkName = Names ''{0}'' and ''{1}'' detected for a single link. Using ''{0}''. |
|
226 +projRead_badLinkType2 = Types ''{0}'' and ''{1}'' detected for a single link. Using ''{0}''. |
|
227 +projRead_badLocation = Locations ''{0}'' and ''{1}'' detected for a single link. Using ''{0}''. |
|
228 +projRead_emptyLinkName = Empty name detected for linked resource with type ''{0}'' and location ''{1}''. |
|
229 +projRead_badLinkType = Illegal link type \"-1\" detected for linked resource with name ''{0}'' and location ''{1}''. |
|
230 +projRead_badLinkLocation = Empty location detected for linked resource with name ''{0}'' and type ''{1}''. |
|
231 +projRead_whichKey = Two values detected for an argument name in a build command: ''{0}'' and ''{1}''. Using ''{0}''. |
|
232 +projRead_whichValue = Two values detected for an argument value in a build command: ''{0}'' and ''{1}''. Using ''{0}''. |
|
233 +projRead_notProjectDescription = Encountered element name ''{0}'' instead of \"project\" when trying to read a project description file. |
|
234 +projRead_failureReadingProjectDesc = Failure occurred reading .project file. |
|
235 + |
|
236 +properties_qualifierIsNull = Qualifier part of property key cannot be null. |
|
237 +properties_readProperties = Failure while reading persistent properties for resource ''{0}'', file was corrupt. Some properties may have been lost. |
|
238 +properties_valueTooLong = Could not set property: {0} {1}. Value is too long. |
|
239 +properties_couldNotClose = Could not close property store for: {0}. |
|
240 + |
|
241 +### auto-refresh |
|
242 +refresh_jobName = Refreshing workspace |
|
243 +refresh_task = Resources to refresh: {0} |
|
244 +refresh_pollJob = Searching for local changes |
|
245 +refresh_refreshErr = Problems occurred while refreshing local changes |
|
246 +refresh_installError = An error occurred while installing an auto-refresh monitor |
|
247 + |
|
248 +resources_cannotModify = The resource tree is locked for modifications. |
|
249 +resources_changeInAdd = Trying to change a marker in an add method. |
|
250 +resources_charsetBroadcasting = Reporting encoding changes. |
|
251 +resources_charsetUpdating = Updating encoding settings. |
|
252 +resources_closing_0 = Closing workspace. |
|
253 +resources_closing_1 = Closing ''{0}''. |
|
254 +resources_copyDestNotSub = Cannot copy ''{0}''. Destination should not be under source''s hierarchy. |
|
255 +resources_copying = Copying ''{0}''. |
|
256 +resources_copying_0 = Copying. |
|
257 +resources_copyNotMet = Copy requirements not met. |
|
258 +resources_copyProblem = Problems encountered while copying resources. |
|
259 +resources_couldnotDelete = Could not delete ''{0}''. |
|
260 +resources_create = Create. |
|
261 +resources_creating = Creating resource ''{0}''. |
|
262 +resources_deleteMeta = Could not delete metadata for ''{0}''. |
|
263 +resources_deleteProblem = Problems encountered while deleting resources. |
|
264 +resources_deleting = Deleting ''{0}''. |
|
265 +resources_deleting_0 = Deleting. |
|
266 +resources_destNotNull = Destination path should not be null. |
|
267 +resources_errorContentDescription = Error retrieving content description for resource ''{0}''. |
|
268 +resources_errorDeleting = Error deleting resource ''{0}'' from the workspace tree. |
|
269 +resources_errorMarkersDelete = Error deleting markers for resource ''{0}''. |
|
270 +resources_errorMarkersMove = Error moving markers from resource ''{0}'' to ''{1}''. |
|
271 +resources_errorMembers = Error retrieving members of container ''{0}''. |
|
272 +resources_errorMoving = Error moving resource ''{0}'' to ''{1}'' in the workspace tree. |
|
273 +resources_errorNature = Error configuring nature ''{0}''. |
|
274 +resources_errorPropertiesMove = Error moving properties for resource ''{0}'' to ''{1}''. |
|
275 +resources_errorRefresh = Errors occurred during refresh of resource ''{0}''. |
|
276 +resources_errorReadProject = Failed to read project description file from location ''{0}''. |
|
277 +resources_errorMultiRefresh = Errors occurred while refreshing resources with the local file system. |
|
278 +resources_errorValidator = Exception running validator code. |
|
279 +resources_errorVisiting = An error occurred while traversing resources. |
|
280 +resources_existsDifferentCase = A resource exists with a different case: ''{0}''. |
|
281 +resources_existsLocalDifferentCase = A resource exists on disk with a different case: ''{0}''. |
|
282 +resources_exMasterTable = Could not read master table. |
|
283 +resources_exReadProjectLocation = Could not read the project location for ''{0}''. |
|
284 +resources_exSafeRead = Could not read safe table. |
|
285 +resources_exSafeSave = Could not save safe table. |
|
286 +resources_exSaveMaster = Could not save master table. |
|
287 +resources_exSaveProjectLocation = Could not save the project location for ''{0}''. |
|
288 +resources_fileExists = A resource already exists on disk ''{0}''. |
|
289 +resources_fileToProj = Cannot copy a file to a project. |
|
290 +resources_flushingContentDescriptionCache = Flushing content description cache. |
|
291 +resources_folderOverFile = Cannot overwrite folder with file ''{0}''. |
|
292 +resources_format = Incompatible file format. Workspace was saved with an incompatible version: {0}. |
|
293 +resources_initValidator = Unable to instantiate validator. |
|
294 +resources_initHook = Unable to instantiate move/delete hook. |
|
295 +resources_initTeamHook = Unable to instantiate team hook. |
|
296 +resources_invalidCharInName = {0} is an invalid character in resource name ''{1}''. |
|
297 +resources_invalidCharInPath = {0} is an invalid character in path ''{1}''. |
|
298 +resources_invalidName = ''{0}'' is an invalid name on this platform. |
|
299 +resources_invalidPath = ''{0}'' is an invalid resource path. |
|
300 +resources_invalidProjDesc = Invalid project description. |
|
301 +resources_invalidResourceName = ''{0}'' is an invalid resource name. |
|
302 +resources_invalidRoot = Root (/) is an invalid resource path. |
|
303 +resources_markerNotFound = Marker id {0} not found. |
|
304 +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. |
|
305 +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. |
|
306 +resources_moveDestNotSub = Cannot move ''{0}''. Destination should not be under source''s hierarchy. |
|
307 +resources_moveMeta = Error moving metadata area from {0} to {1}. |
|
308 +resources_moveNotMet = Move requirements not met. |
|
309 +resources_moveNotProject = Cannot move ''{0}'' to ''{1}''. Source must be a project. |
|
310 +resources_moveProblem = Problems encountered while moving resources. |
|
311 +resources_moveRoot = Cannot move the workspace root. |
|
312 +resources_moving = Moving ''{0}''. |
|
313 +resources_moving_0 = Moving. |
|
314 +resources_mustBeAbsolute = Path ''{0}'' must be absolute. |
|
315 +resources_mustBeLocal = Resource ''{0}'' is not local. |
|
316 +resources_mustBeOpen = Resource ''{0}'' is not open. |
|
317 +resources_mustExist = Resource ''{0}'' does not exist. |
|
318 +resources_mustNotExist = Resource ''{0}'' already exists. |
|
319 +resources_nameEmpty = Names cannot be empty. |
|
320 +resources_nameNull = Name must not be null. |
|
321 +resources_natureClass = Missing project nature class for ''{0}''. |
|
322 +resources_natureDeconfig = Error deconfiguring nature: {0}. |
|
323 +resources_natureExtension = Missing project nature extension for {0}. |
|
324 +resources_natureFormat = Project nature {0} does not specify a runtime attribute. |
|
325 +resources_natureImplement = Project nature {0} does not implement IProjectNature. |
|
326 +resources_notChild = Resource ''{0}'' is not a child of ''{1}''. |
|
327 +resources_oneValidator = There must be exactly 0 or 1 validator extensions defined in the fileModificationValidator extension point. |
|
328 +resources_oneHook = There must be exactly 0 or 1 hook extensions defined in the moveDeleteHook extension point. |
|
329 +resources_oneTeamHook = There must be exactly 0 or 1 hook extensions defined in the teamHook extension point. |
|
330 +resources_opening_1 = Opening ''{0}''. |
|
331 +resources_overlapWorkspace = {0} overlaps the workspace location: {1} |
|
332 +resources_overlapProject = {0} overlaps the location of another project: ''{1}'' |
|
333 +resources_pathNull = Paths must not be null. |
|
334 +resources_projectDesc = Problems encountered while setting project description. |
|
335 +resources_projectDescSync = Could not set the project description for ''{0}'' because the project description file (.project) is out of sync with the file system. |
|
336 +resources_projectPath = Path for project must have only one segment. |
|
337 +resources_reading = Reading. |
|
338 +resources_readingSnap = Reading snapshot. |
|
339 +resources_readingEncoding = Could not read encoding settings. |
|
340 +resources_readMarkers = Failure while reading markers, the marker file was corrupt. Some markers may be lost. |
|
341 +resources_readMeta = Could not read metadata for ''{0}''. |
|
342 +resources_readMetaWrongVersion = Could not read metadata for ''{0}''. Unexpected version: {1}. |
|
343 +resources_readOnly = Resource ''{0}'' is read-only. |
|
344 +resources_readOnly2 = Cannot edit read-only resources. |
|
345 +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. |
|
346 +resources_readProjectTree = Problems reading project tree. |
|
347 +resources_readSync = Errors reading sync info file: {0}. |
|
348 +resources_readWorkspaceMeta = Could not read workspace metadata. |
|
349 +resources_readWorkspaceMetaValue = Invalid attribute value in workspace metadata: {0}. Value will be ignored. |
|
350 +resources_readWorkspaceSnap = Problems reading workspace tree snapshot. |
|
351 +resources_readWorkspaceTree = Problems reading workspace tree. |
|
352 +resources_refreshing = Refreshing ''{0}''. |
|
353 +resources_refreshingRoot = Refreshing workspace. |
|
354 +resources_resetMarkers = Could not reset markers snapshot file. |
|
355 +resources_resetSync = Could not reset sync info snapshot file. |
|
356 +resources_resourcePath = Invalid path for resource ''{0}''. Must include project and resource name. |
|
357 +resources_saveOp = Save cannot be called from inside an operation. |
|
358 +resources_saveProblem = Problems occurred during save. |
|
359 +resources_saveWarnings = Save operation warnings. |
|
360 +resources_saving_0 = Saving workspace. |
|
361 +resources_savingEncoding = Could not save encoding settings. |
|
362 +resources_setDesc = Setting project description. |
|
363 +resources_setLocal = Setting resource local flag. |
|
364 +resources_settingCharset = Setting character set for resource ''{0}''. |
|
365 +resources_settingDefaultCharsetContainer = Setting default character set for resource ''{0}''. |
|
366 +resources_settingContents = Setting contents for ''{0}''. |
|
367 +resources_shutdown = Workspace was not properly initialized or has already shutdown. |
|
368 +resources_shutdownProblems = Problem on shutdown. |
|
369 +resources_snapInit = Could not initialize snapshot file. |
|
370 +resources_snapRead = Could not read snapshot file. |
|
371 +resources_snapRequest = Snapshot requested. |
|
372 +resources_snapshot = Periodic workspace save. |
|
373 +resources_startupProblems = Workspace restored, but some problems occurred. |
|
374 +resources_touch = Touching resource ''{0}''. |
|
375 +resources_updating = Updating workspace |
|
376 +resources_updatingEncoding = Problems encountered while updating encoding settings. |
|
377 +resources_workspaceClosed = Workspace is closed. |
|
378 +resources_workspaceOpen = The workspace is already open. |
|
379 +resources_writeMeta = Could not write metadata for ''{0}''. |
|
380 +resources_writeWorkspaceMeta = Could not write workspace metadata ''{0}''. |
|
381 + |
|
382 +synchronizer_partnerNotRegistered = Sync partner: {0} not registered with the synchronizer. |
|
383 + |
|
384 +### URL |
|
385 +url_badVariant = Unsupported \"platform:\" protocol variation {0}. |
|
386 +url_couldNotResolve = Project ''{0}'' does not exist. Could not resolve URL: {1}. |
|
387 + |
|
388 +### utils |
|
389 +utils_clone = Clone not supported. |
|
390 +utils_stringJobName = Compacting memory |
|
391 + |
|
392 +### watson |
|
393 +watson_elementNotFound = Element not found: {0}. |
|
394 +watson_illegalSubtree = Illegal subtree passed to createSubtree(). |
|
395 +watson_immutable = Attempt to modify an immutable tree. |
|
396 +watson_noModify = Cannot modify implicit root node. |
|
397 +watson_nullArg = Null argument to {0}. |
|
398 +watson_unknown = Unknown format. |
|
399 + |
|
400 +### auto-refresh win32 native |
|
401 +WM_beginTask = finding out of sync resources |
|
402 +WM_jobName = Win32 refresh daemon |
|
403 +WM_errors = Problems occurred refreshing resources |
|
404 +WM_nativeErr = Problem occurred in auto-refresh native code: {0}. |
|
405 +WM_errCloseHandle = Problem closing native refresh handle: {0}. |
|
406 +WM_errCreateHandle = Problem creating handle for {0}, code: {0}. |
|
407 +WM_errFindChange = Problem finding next change, code: {0} |
|
408 diff -r 3ac8c55882b5 -r 06d88bb6aac0 platform/org.eclipse.core.resources/src/org/eclipse/core/resources/DiagnosticLog.java |
|
409 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
|
410 +++ b/platform/org.eclipse.core.resources/src/org/eclipse/core/resources/DiagnosticLog.java Tue Jun 02 09:59:27 2009 -0500 |
|
411 @@ -0,0 +1,95 @@ |
|
412 +/* |
|
413 +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
414 +* All rights reserved. |
|
415 +* This component and the accompanying materials are made available |
|
416 +* under the terms of the License "Eclipse Public License v1.0" |
|
417 +* which accompanies this distribution, and is available |
|
418 +* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
419 +* |
|
420 +* Initial Contributors: |
|
421 +* Nokia Corporation - initial contribution. |
|
422 +* |
|
423 +* Contributors: |
|
424 +* |
|
425 +* Description: |
|
426 +* |
|
427 +*/ |
|
428 +package org.eclipse.core.resources; |
|
429 + |
|
430 +import java.io.File; |
|
431 +import java.io.IOException; |
|
432 +import java.util.logging.FileHandler; |
|
433 +import java.util.logging.Handler; |
|
434 +import java.util.logging.Level; |
|
435 +import java.util.logging.LogRecord; |
|
436 +import java.util.logging.Logger; |
|
437 + |
|
438 +public class DiagnosticLog { |
|
439 + private String name; |
|
440 + private String id; |
|
441 + private Logger logger; |
|
442 + private File file; |
|
443 + |
|
444 + private class LogHandler extends Handler { |
|
445 + |
|
446 + FileHandler fileHandler; |
|
447 + File file; |
|
448 + |
|
449 + public LogHandler(File file) { |
|
450 + this.file = file; |
|
451 + } |
|
452 + |
|
453 + public void close() throws SecurityException { |
|
454 + if (fileHandler != null) |
|
455 + fileHandler.close(); |
|
456 + } |
|
457 + |
|
458 + public void flush() { |
|
459 + if (fileHandler != null) |
|
460 + fileHandler.flush(); |
|
461 + } |
|
462 + |
|
463 + public void publish(LogRecord record) { |
|
464 + if (fileHandler == null) |
|
465 + { |
|
466 + try { |
|
467 + fileHandler= new FileHandler(file.getAbsolutePath()); |
|
468 + } catch (SecurityException e) { |
|
469 + e.printStackTrace(); |
|
470 + } catch (IOException e) { |
|
471 + e.printStackTrace(); |
|
472 + } |
|
473 + } |
|
474 + if (fileHandler != null) |
|
475 + fileHandler.publish(record); |
|
476 + } |
|
477 + |
|
478 + } |
|
479 + |
|
480 + public DiagnosticLog(String name, String id, String logFilePath) { |
|
481 + this.name = name; |
|
482 + this.id = id; |
|
483 + this.logger = Logger.getLogger(id); |
|
484 + logger.setLevel(Level.OFF); |
|
485 + logger.setUseParentHandlers(false); |
|
486 + this.file = new File(logFilePath); |
|
487 + logger.addHandler(new LogHandler(file)); |
|
488 + } |
|
489 + |
|
490 + public String getName() { |
|
491 + return name; |
|
492 + } |
|
493 + |
|
494 + public String getId() { |
|
495 + return id; |
|
496 + } |
|
497 + |
|
498 + public File getFile() { |
|
499 + return file; |
|
500 + } |
|
501 + |
|
502 + public Logger getLogger() { |
|
503 + return logger; |
|
504 + } |
|
505 + |
|
506 +} |
|
507 \ No newline at end of file |
|
508 diff -r 3ac8c55882b5 -r 06d88bb6aac0 platform/org.eclipse.core.resources/src/org/eclipse/core/resources/ResourcesPlugin.java |
|
509 --- a/platform/org.eclipse.core.resources/src/org/eclipse/core/resources/ResourcesPlugin.java Mon Jun 01 19:29:06 2009 -0500 |
|
510 +++ b/platform/org.eclipse.core.resources/src/org/eclipse/core/resources/ResourcesPlugin.java Tue Jun 02 09:59:27 2009 -0500 |
|
511 @@ -18,6 +18,8 @@ |
|
512 import org.osgi.framework.BundleActivator; |
|
513 import org.osgi.framework.BundleContext; |
|
514 |
|
515 +import java.util.logging.Level; |
|
516 + |
|
517 /** |
|
518 * The plug-in runtime class for the Resources plug-in. This is |
|
519 * the starting point for all workspace and resource manipulation. |
|
520 @@ -29,6 +31,7 @@ |
|
521 * @noinstantiate This class is not intended to be instantiated by clients. |
|
522 */ |
|
523 public final class ResourcesPlugin extends Plugin { |
|
524 + |
|
525 /** |
|
526 * Unique identifier constant (value <code>"org.eclipse.core.resources"</code>) |
|
527 * for the standard Resources plug-in. |
|
528 @@ -267,6 +270,10 @@ |
|
529 */ |
|
530 private static Workspace workspace = null; |
|
531 |
|
532 + |
|
533 + private static final String REFRESH_LOG_ID = ".refresh.log"; |
|
534 + private DiagnosticLog refreshLog; |
|
535 + |
|
536 /** |
|
537 * Constructs an instance of this plug-in runtime class. |
|
538 * <p> |
|
539 @@ -377,4 +384,18 @@ |
|
540 if (!result.isOK()) |
|
541 getLog().log(result); |
|
542 } |
|
543 + |
|
544 + public static void writeRefreshLog(String s) { |
|
545 + if (!plugin.getPluginPreferences().getBoolean(PI_RESOURCES + REFRESH_LOG_ID)) |
|
546 + return; |
|
547 + |
|
548 + if (plugin.refreshLog == null) { |
|
549 + IPath path = getWorkspace().getRoot().getLocation().append("refresh.log"); |
|
550 + plugin.refreshLog = new DiagnosticLog("refresh.log", PI_RESOURCES + REFRESH_LOG_ID, path.toOSString()); |
|
551 + plugin.refreshLog.getLogger().setLevel(Level.INFO); |
|
552 + } |
|
553 + |
|
554 + plugin.refreshLog.getLogger().info(s); |
|
555 + System.out.println(s); |
|
556 + } |
|
557 } |
|