Community
Participate
Working Groups
Build Identifier: I20101208-1300 Currently, when the method CodanBuider.incrementalBuild(IResourceDelta, IProgressMonitor) is invoked, checkers are called too many times for a single resource. The number of times checkers are called is directly proportional to the number of folders up in the hierarchy of a resource. For example, given the resource: a/b/c/d/e/f.cpp checkers will process f.cpp 5 times! one time per folder in the hierarchy. I looked at the source code and this is what I saw. CodanDeltaVisitor visits every resource (which is correct,) then calls 'processResource(IResource, IProgressMonitor)' to process the visited resource (so far so good.) The problem is that 'processResource' checks if the resource is a Container, and if it is, process its children. In our example, when CodanDeltaVisitor is visiting folder 'a', 'processResource' will process 'a' all the way to f.cpp. Then CodanDeltaVisitor will process 'b' and 'processResource' then again will process b's children. At least in an incremental build, IMHO, 'processResource' should not recursively process a resource's children, since they are going to be processed anyway when CodanDeltaVisitor visits such children. Reproducible: Always Steps to Reproduce: 1. Get CDT source code: http://wiki.eclipse.org/Getting_started_with_CDT_development 2. Set a breakpoint in class org.eclipse.cdt.codan.internal.core.CodanBuilder, in method 'visit' in inner class CodanDeltaVisitor (line 51) and method 'processResource' (line 94.) 3. Debug project org.eclipse.cdt.ui as an "Eclipse Application" 4. In the launched Eclipse, create a C++ project with a single C++ file, within a hierarchy of two folders or more. 5. In the project properties, set up Codan to be ran with build (C++ General -> Code Analysis -> Launching) 6. Make some modifications to the cpp file and see how the behavior described in this bug happens
fixed in 8.0. When processing from delta do not run it recursively.
*** cdt cvs genie on behalf of elaskavaia *** Bug 336396: fixed double processing of files on build [*] CodanBuilder.java 1.14 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/CodanBuilder.java?root=Tools_Project&r1=1.13&r2=1.14