Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 312420 - Publish cache does not detect changes
Summary: Publish cache does not detect changes
Status: RESOLVED FIXED
Alias: None
Product: WTP ServerTools
Classification: WebTools
Component: wst.server (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: 3.2 RC1   Edit
Assignee: Angel Vera CLA
QA Contact: Angel Vera CLA
URL:
Whiteboard: PMC_approved
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-11 09:28 EDT by Angel Vera CLA
Modified: 2017-10-11 16:33 EDT (History)
1 user (show)

See Also:
arvera: pmc_approved? (david_williams)
arvera: pmc_approved? (raghunathan.srinivasan)
arvera: pmc_approved? (naci.dai)
arvera: pmc_approved? (deboer)
arvera: pmc_approved? (neil.hauge)
kaloyan: pmc_approved+


Attachments
v1.0 (2.88 KB, patch)
2010-05-11 09:28 EDT, Angel Vera CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Angel Vera CLA 2010-05-11 09:28:01 EDT
Created attachment 167915 [details]
v1.0

the publish cache has a method that is supposed to return true if the publish cache and the module list are different. This method assumes that all objects are the same and just compares the sizes of the array.

The correct implementation should be to compare the size of the array first, and if arrays are the same size then further compare the objects inside to ensure that all objects are the same.
Comment 1 Angel Vera CLA 2010-05-11 09:34:09 EDT
* Explain why you believe this is a stop-ship defect. Or, if it is a "hotbug" (requested by an adopter) please document it as such. 
This is a major function for adopters to display that there is changes on the server and that they need to republish the app, in certain scenarios

* Is there a work-around? If so, why do you believe the work-around is insufficient? 
no workaround

* How has the fix been tested? Is there a test case attached to the bugzilla record? Has a JUnit Test been added? 
I tested the function using a few publish scenarios

* Give a brief technical overview. Who has reviewed this fix? 
The function was incorrect on just checking the size of the arrays, checking the size of the arrays, is insufficient to compare that two objects are the same.

* What is the risk associated with this fix? 
low as the old function was kept untouched, but we are now doing further processing
Comment 2 Kaloyan Raev CLA 2010-05-11 10:00:31 EDT
The reason for the change looks OK. 

Patch looks correct too, but I have a question on the code. 
Why an array of a single boolean value is used for a flag? Doesn't a simple boolean variable work well too? Just wondering...
Comment 3 Angel Vera CLA 2010-05-11 10:05:46 EDT
Kayolan, In this case, I haven't studied the reasons enough to give you a smart answer. I am mainly following my predecessor coding style :).
Comment 4 Angel Vera CLA 2010-05-11 11:37:40 EDT
changes committed to HEAD
Comment 5 Angel Vera CLA 2010-05-11 11:48:51 EDT
Changes released to HEAD
Comment 6 Eclipse Genie CLA 2017-10-11 16:33:15 EDT
New Gerrit change created: https://git.eclipse.org/r/108943