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 4518 Details for
Bug 35528
When I check out a project from CVS, Updating takes a very long time
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Proposed implementation as an attachment
a.txt (text/plain), 3.34 KB, created by
Philipe Mulet
on 2003-04-09 07:06:23 EDT
(
hide
)
Description:
Proposed implementation as an attachment
Filename:
MIME Type:
Creator:
Philipe Mulet
Created:
2003-04-09 07:06:23 EDT
Size:
3.34 KB
patch
obsolete
>/** > * Update cycle markers for all java projects > */ >public static void updateAllCycleMarkers() throws JavaModelException { > > JavaModelManager manager = JavaModelManager.getJavaModelManager(); > IJavaProject[] projects = manager.getJavaModel().getJavaProjects(); > IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot(); > > HashSet cycleParticipants = new HashSet(); > HashSet alreadyTraversed = new HashSet(); > int length = projects.length; > > // compute cycle participants > ArrayList prereqChain = new ArrayList(); > for (int i = 0; i < length; i++){ > JavaProject project = (JavaProject)projects[i]; > if (!alreadyTraversed.contains(project)){ > prereqChain.clear(); > project.updateCycleParticipants(null, prereqChain, cycleParticipants, workspaceRoot, alreadyTraversed); > } > } > > for (int i = 0; i < length; i++){ > JavaProject project = (JavaProject)projects[i]; > > if (cycleParticipants.contains(project)){ > IMarker cycleMarker = project.getCycleMarker(); > String circularCPOption = project.getOption(JavaCore.CORE_CIRCULAR_CLASSPATH, true); > int circularCPSeverity = JavaCore.ERROR.equals(circularCPOption) ? IMarker.SEVERITY_ERROR : IMarker.SEVERITY_WARNING; > if (cycleMarker != null) { > // update existing cycle marker if needed > try { > int existingSeverity = ((Integer)cycleMarker.getAttribute(IMarker.SEVERITY)).intValue(); > if (existingSeverity != circularCPSeverity) { > cycleMarker.setAttribute(IMarker.SEVERITY, circularCPSeverity); > } > } catch (CoreException e) { > throw new JavaModelException(e); > } > } else { > // create new marker > project.createClasspathProblemMarker( > new JavaModelStatus(IJavaModelStatusConstants.CLASSPATH_CYCLE, project)); > } > } else { > project.flushClasspathProblemMarkers(true, false); > } > } >} > >/** > * If a cycle is detected, then cycleParticipants contains all the project involved in this cycle (directly and indirectly), > * no cycle if the set is empty (and started empty) > */ >public void updateCycleParticipants( > IClasspathEntry[] preferredClasspath, > ArrayList prereqChain, > HashSet cycleParticipants, > IWorkspaceRoot workspaceRoot, > HashSet alreadyTraversed){ > > prereqChain.add(this); > try { > IClasspathEntry[] classpath = preferredClasspath == null ? getResolvedClasspath(true) : preferredClasspath; > for (int i = 0, length = classpath.length; i < length; i++) { > IClasspathEntry entry = classpath[i]; > > if (entry.getEntryKind() == IClasspathEntry.CPE_PROJECT){ > IPath entryPath = entry.getPath(); > IResource member = workspaceRoot.findMember(entryPath); > if (member != null && member.getType() == IResource.PROJECT){ > JavaProject project = (JavaProject)JavaCore.create((IProject)member); > int index = cycleParticipants.contains(project) ? 0 : prereqChain.indexOf(project); > if (index >= 0) { // refer to cycle, or in cycle itself > for (int size = prereqChain.size(); index < size; index++) { > cycleParticipants.add(prereqChain.get(index)); > } > } else { > if (!alreadyTraversed.contains(project)) { > project.updateCycleParticipants(null, prereqChain, cycleParticipants, workspaceRoot, alreadyTraversed); > } > } > } > } > } > } catch(JavaModelException e){ > } > prereqChain.remove(this); > alreadyTraversed.add(this); >}
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 Raw
Actions:
View
Attachments on
bug 35528
: 4518