Hi, Aaron,

I see the cause of the problem. I will check whether the longest path as root principle is applied or not. It is the only possible cause comes into my mind. Thanks for your time to find it out. That piece of code was suspicious to me but I spent my most effort on case insensitivity and workspace comparison performance.

Happy Presidential Day!
Hongbing

Aaron Kagawa wrote:

I'm on the trail of the problem; hunting it down.

Here is an update. It seems that
a) everything works ok, after a restart of Hackystat
b) the error occurs after changing/adding a workspace root.

I don't have a lot of time to explain, but take a look at the following files.

1) http://csdl.ics.hawaii.edu/~kagawaa/workspace/broken-before-rootchange.JPG <http://csdl.ics.hawaii.edu/%7Ekagawaa/workspace/broken-before-rootchange.JPG> http://csdl.ics.hawaii.edu/~kagawaa/workspace/broken-rootchange.JPG <http://csdl.ics.hawaii.edu/%7Ekagawaa/workspace/broken-rootchange.JPG> http://csdl.ics.hawaii.edu/~kagawaa/workspace/broken-after-rootchange.JPG

<http://csdl.ics.hawaii.edu/%7Ekagawaa/workspace/broken-after-rootchange.JPG>here are some screen shots that step you through the process i go through.

2) http://csdl.ics.hawaii.edu/~kagawaa/workspace/akagawa1.zip

<http://csdl.ics.hawaii.edu/%7Ekagawaa/workspace/akagawa1.zip>If you want to try to duplicate the error, download this zip file. It contains some fake data that should replicate the problem on your machine. Remember:
a) everything works ok, after a restart of Hackystat
b) the error occurs after changing/adding a workspace root.


3) http://csdl.ics.hawaii.edu/~kagawaa/workspace/DailyProjectJavaFileMetric.java <http://csdl.ics.hawaii.edu/%7Ekagawaa/workspace/DailyProjectJavaFileMetric.java> http://csdl.ics.hawaii.edu/~kagawaa/workspace/Workspace.java <http://csdl.ics.hawaii.edu/%7Ekagawaa/workspace/Workspace.java> http://csdl.ics.hawaii.edu/~kagawaa/workspace/WorkspaceCache.java

<http://csdl.ics.hawaii.edu/%7Ekagawaa/workspace/WorkspaceCache.java>Here are the java files that I added the printlns to.


4) http://csdl.ics.hawaii.edu/~kagawaa/workspace/broken-log.txt <http://csdl.ics.hawaii.edu/%7Ekagawaa/workspace/broken-log.txt>

This is a log of some of the system.out.println's that I used to track down the problem. I set up these printlns to be able to find out why some of the workspaces were not being used in the DailyProjectJavaFileMetric Maps. So, look for


#########################################################
FileMetric analyzing:
D:\java\cruisecontrol-work\checkout\brokenProject\moduleA\java\src\edu\hawaii\broken\modulea\
        passedTrimmedPath: moduleA\,
parentLength: 8
        this.root:
D:\java\cruisecontrol-work\checkout\brokenProject\
        this.canonicalPath:
D:\java\cruisecontrol-work\checkout\brokenProject\moduleA\java\src\edu\hawaii\broken\modulea\
        trimmedPath:
moduleA\java\src\edu\hawaii\broken\modulea\,
moduleA\java\src\edu\hawaii\broken\modulea\
        cutWorkspace: moduleA\
        passedTrimmedPath: moduleA\
ACCEPTED

...


FileMetric processing
D:\java\cruisecontrol-work\checkout\brokenProject\moduleA\java\src\edu\hawaii\broken\modulea\


This indicates that the workspace was added to the map ok and was processed by the DailyProjectJavaFileMetric to return FileMetrics. This is associated with http://csdl.ics.hawaii.edu/~kagawaa/workspace/broken-before-rootchange.JPG <http://csdl.ics.hawaii.edu/%7Ekagawaa/workspace/broken-before-rootchange.JPG>

Then, I changed the workspace root ( http://csdl.ics.hawaii.edu/~kagawaa/workspace/broken-rootchange.JPG <http://csdl.ics.hawaii.edu/%7Ekagawaa/workspace/broken-rootchange.JPG>)


WorkspaceCache.newWorkspaceRoots:
        root:
D:\java\cruisecontrol-work\checkout\
        workspace:
D:\java\cruisecontrol-work\checkout\brokenProject\moduleA\java\src\edu\hawaii\

This shows a wrong root being used for this workspace. It should have been D:\java\cruisecontrol-work\checkout\brokenProject. Thus, the workspace won't be used correctly in the DailyProjectJavaFileMetric.


#########################################################
FileMetric analyzing:
D:\java\cruisecontrol-work\checkout\brokenProject\moduleA\java\src\edu\hawaii\broken\modulea\
        passedTrimmedPath: moduleA\,
parentLength: 8
        this.root:
D:\java\cruisecontrol-work\checkout\
        this.canonicalPath:
D:\java\cruisecontrol-work\checkout\brokenProject\moduleA\java\src\edu\hawaii\broken\modulea\
        trimmedPath:
brokenProject\moduleA\java\src\edu\hawaii\broken\modulea\,
brokenProject\moduleA\java\src\edu\hawaii\broken\modulea\
        cutWorkspace: brokenPr
        passedTrimmedPath: moduleA\

See.. this workspace wasn't ACCEPTED any more, because the cutWorkspace and passedTrimmedPath aren't the same anymore ( http://csdl.ics.hawaii.edu/~kagawaa/workspace/broken-after-rootchange.JPG <http://csdl.ics.hawaii.edu/%7Ekagawaa/workspace/broken-after-rootchange.JPG> )


Ok. Sorry that is really cryptic. I don't have time this morning to make this better.


After all that, I think there is a problem with WorkspaceCache.newWorkspaceRoots and/or Workspace.isRoot. It would be really great if someone could turn this into a testdataset and Unit Test (well, maybe this is a System Test).

thanks, aaron

Reply via email to