Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 210005 Details for
Bug 369587
V2 Validation Framework ignoring IResourceDelta.REMOVED events
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Proposed R3_2_5_P patch
BugzillaRemoveEvent_R3_2_PV2.patch (text/plain), 5.35 KB, created by
Rosendo Martinez
on 2012-01-24 15:09:34 EST
(
hide
)
Description:
Proposed R3_2_5_P patch
Filename:
MIME Type:
Creator:
Rosendo Martinez
Created:
2012-01-24 15:09:34 EST
Size:
5.35 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.wst.validation >Index: vf2/org/eclipse/wst/validation/internal/MarkerManager.java >=================================================================== >RCS file: /cvsroot/webtools/common/plugins/org.eclipse.wst.validation/vf2/org/eclipse/wst/validation/internal/MarkerManager.java,v >retrieving revision 1.16 >diff -u -r1.16 MarkerManager.java >--- vf2/org/eclipse/wst/validation/internal/MarkerManager.java 1 May 2009 05:08:05 -0000 1.16 >+++ vf2/org/eclipse/wst/validation/internal/MarkerManager.java 20 Jan 2012 17:31:50 -0000 >@@ -106,7 +106,11 @@ > */ > public void deleteMarkers(IResource resource, long operationStartTime, int depth){ > try { >- hook(resource); >+ hook(resource); >+ >+ if(!resource.exists()) >+ return; >+ > IMarker[] markers = resource.findMarkers(null, true, depth); > String markerType; > for (IMarker marker : markers){ >Index: vf2/org/eclipse/wst/validation/internal/ValOperation.java >=================================================================== >RCS file: /cvsroot/webtools/common/plugins/org.eclipse.wst.validation/vf2/org/eclipse/wst/validation/internal/ValOperation.java,v >retrieving revision 1.11 >diff -u -r1.11 ValOperation.java >--- vf2/org/eclipse/wst/validation/internal/ValOperation.java 21 Jan 2009 17:28:18 -0000 1.11 >+++ vf2/org/eclipse/wst/validation/internal/ValOperation.java 20 Jan 2012 17:31:50 -0000 >@@ -62,6 +62,8 @@ > */ > private final Map<String, Set<IResource>> _validated = new HashMap<String, Set<IResource>>(20); > >+ private final Set<IResource> _validatedProjects = new HashSet<IResource>(20); >+ > public ValOperation(){ > _multiProject = false; > } >@@ -116,6 +118,19 @@ > } > > /** >+ * Remember that this resource has been validated >+ * >+ * @param resource resource that has been validated. >+ */ >+ >+ public void addValidatedProject(IResource resource){ >+ synchronized(_validatedProjects){ >+ if (resource != null) >+ _validatedProjects.add(resource); >+ } >+ } >+ >+ /** > * Answer if this resource has already been validated as a side-effect of some other validation by the > * given validator. > * >@@ -130,6 +145,18 @@ > return set.contains(resource); > } > } >+ >+ /** >+ * Answer if this resource has been validated >+ * >+ * @param resource >+ */ >+ >+ public boolean isValidatedProject(IResource resource){ >+ synchronized(_validatedProjects){ >+ return _validatedProjects.contains(resource); >+ } >+ } > > /** > * Has this validator been suspended for the duration of this operation on this project? >Index: vf2/org/eclipse/wst/validation/internal/ValBuilderJob.java >=================================================================== >RCS file: /cvsroot/webtools/common/plugins/org.eclipse.wst.validation/vf2/org/eclipse/wst/validation/internal/ValBuilderJob.java,v >retrieving revision 1.25.2.1 >diff -u -r1.25.2.1 ValBuilderJob.java >--- vf2/org/eclipse/wst/validation/internal/ValBuilderJob.java 21 Mar 2011 20:22:13 -0000 1.25.2.1 >+++ vf2/org/eclipse/wst/validation/internal/ValBuilderJob.java 20 Jan 2012 17:31:50 -0000 >@@ -320,12 +320,23 @@ > // Check for file ADDED and REMOVED events, which means that the file may have moved to a new > // project. To be safe we clear it's cached list of validators. > if (((kind & (IResourceDelta.ADDED | IResourceDelta.REMOVED)) != 0) && resource.getType() == IResource.FILE) { >- ValManager.getDefault().clearValProperty(resource); >+ ValManager.getDefault().clearValProperty(resource.getProject()); > } > > if ((kind & (IResourceDelta.ADDED | IResourceDelta.CHANGED)) != 0){ >- ValManager.getDefault().validate(_request.getProject(), resource, delta.getKind(), ValType.Build, >- _request.getBuildKind(), _operation, _subMonitor.newChild(1)); >+ ValManager.getDefault().validate(_request.getProject(), resource, delta.getKind(), ValType.Build, >+ _request.getBuildKind(), _operation, _subMonitor.newChild(1)); >+ } >+ >+ if ((kind & (IResourceDelta.REMOVED)) != 0){ >+ >+ IResource project = resource.getProject(); >+ if (!_operation.isValidatedProject(project)) >+ { >+ ValManager.getDefault().validate(_request.getProject(), project, IResourceDelta.REMOVED, ValType.Build, >+ _request.getBuildKind(), _operation, _subMonitor.newChild(1)); >+ _operation.addValidatedProject(project); >+ } > } > > IDependencyIndex index = ValidationFramework.getDefault().getDependencyIndex(); >@@ -335,18 +346,14 @@ > Validator val = dr.getValidator(); > if (Friend.shouldValidate(val, dr.getResource(), ValType.Build, new ContentTypeWrapper())){ > _operation.getState().put(ValidationState.TriggerResource, resource); >- ValidationEvent event = new ValidationEvent(dr.getResource(), IResourceDelta.NO_CHANGE, delta); >- if (val.shouldClearMarkers(event))mm.clearMarker(dr.getResource(), val); >- ValManager.getDefault().validate(val, _operation, dr.getResource(), >- IResourceDelta.NO_CHANGE, _monitor, event); >+ ValidationEvent event = new ValidationEvent(dr.getResource(), delta.getKind(), delta); >+ if (val.shouldClearMarkers(event))mm.clearMarker(dr.getResource(), val); >+ ValManager.getDefault().validate(val, _operation, dr.getResource(), >+ delta.getKind(), _monitor, event); >+ } > } > } >- } >- > return true; > } >- >- > } >- > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 369587
:
210005
|
212235