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 165605 Details for
Bug 308326
Validation Framework invokes the V1 validators too often
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]
Patch to fix the EE validator performance problem
patch.txt (text/plain), 3.00 KB, created by
Wini Mark
on 2010-04-21 13:37:54 EDT
(
hide
)
Description:
Patch to fix the EE validator performance problem
Filename:
MIME Type:
Creator:
Wini Mark
Created:
2010-04-21 13:37:54 EDT
Size:
3.00 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.wst.validation >Index: vf2/org/eclipse/wst/validation/Validator.java >=================================================================== >RCS file: /cvsroot/webtools/common/plugins/org.eclipse.wst.validation/vf2/org/eclipse/wst/validation/Validator.java,v >retrieving revision 1.34.2.10.2.1 >diff -u -r1.34.2.10.2.1 Validator.java >--- vf2/org/eclipse/wst/validation/Validator.java 5 Oct 2009 22:15:04 -0000 1.34.2.10.2.1 >+++ vf2/org/eclipse/wst/validation/Validator.java 23 Mar 2010 20:37:51 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2007, 2008 IBM Corporation and others. >+ * Copyright (c) 2007, 2010 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 >@@ -13,10 +13,12 @@ > import java.lang.reflect.InvocationTargetException; > import java.util.ArrayList; > import java.util.HashMap; >+import java.util.HashSet; > import java.util.Iterator; > import java.util.LinkedList; > import java.util.List; > import java.util.Map; >+import java.util.Set; > import java.util.concurrent.atomic.AtomicBoolean; > > import org.eclipse.core.resources.IMarker; >@@ -748,6 +750,9 @@ > IValidator v = asIValidator(); > if (v == null)return null; > >+ //TODO Workaround for the EAR validator, we still need a more general fix for this. >+ if (shouldSkipValidator(resource, operation))return null; >+ > try { > IProject project = resource.getProject(); > SummaryReporter reporter = new SummaryReporter(project, monitor); >@@ -783,6 +788,33 @@ > return vr; > } > >+ private static final String EAR_VALIDATOR_ID = "org.eclipse.jst.j2ee.internal.validation.UIEarValidator"; //$NON-NLS-1$ >+ private static final String TEST_FIX_STATE_ID = "TestFixStateID"; //$NON-NLS-1$ >+ >+ @SuppressWarnings("unchecked") >+ >+ //TODO A temporary workaround for the problem of manual validations calling V1 validators too often >+ private boolean shouldSkipValidator(IResource resource, ValOperation operation) { >+ >+ if (EAR_VALIDATOR_ID.equals(getId())) { >+ ValidationState validationState = operation.getState(); >+ Object testFixState = validationState.get(TEST_FIX_STATE_ID); >+ Set<String> projectsNameSet = null; >+ String projectName = resource.getProject().getName(); >+ >+ if (testFixState == null) { >+ projectsNameSet = new HashSet<String>(); >+ validationState.put(TEST_FIX_STATE_ID, projectsNameSet); >+ } else { >+ projectsNameSet = (Set<String>) testFixState; >+ } >+ >+ if (projectsNameSet.contains(projectName))return true; >+ else projectsNameSet.add(projectName); >+ } >+ return false; >+ } >+ > /* > * GRK - Because I didn't want to try to make a true copy of the V1 validator, (because I didn't > * want to copy the vmd object), I came up with this approach to only copy the fields that
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 308326
:
165605
|
168441
|
168905