Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 312490

Summary: Unnecessary tracing errors
Product: [WebTools] WTP ServerTools Reporter: Troy Bishop <tjbishop>
Component: wst.serverAssignee: Angel Vera <arvera>
Status: RESOLVED FIXED QA Contact: Angel Vera <arvera>
Severity: minor    
Priority: P3 CC: eyuen7
Version: 3.2   
Target Milestone: 3.2.2   
Hardware: PC   
OS: Windows XP   
See Also: https://git.eclipse.org/r/108982
Whiteboard:
Attachments:
Description Flags
Possible patch none

Description Troy Bishop CLA 2010-05-11 15:29:53 EDT
Build Identifier: WTP 3.2

While tracing a publishing problem in a WTP adopter product I noticed a lot of tracing messages saying "Could not find <name> Reverting to default behaviour".  It turns out that this tracing message is happening because of binary JEE 5 modules.  If you have a binary JEE 5 module then it is not a project and therefore causes an IllegalArgumentException on the call to  getWorkspaceRoot().getProject(id);

I think a better way to handle this implementation would be to check the number of segments in the specified id.  If it is more than 1 then the id cannot be a project so the logic in ProjectModuleFactoryDelegate#findModule(String) should not be executed.  Only the call to super.findModule(id) should happen in this situation and no trace string should be printed since it's not an error situation.

Reproducible: Always
Comment 1 Troy Bishop CLA 2010-05-11 15:30:10 EDT
Created attachment 168009 [details]
Possible patch
Comment 2 Elson Yuen CLA 2010-08-23 14:54:57 EDT
The removal of the try catch block may cause a change in behaviour.  For example, the existing code used to catch some exceptions before the change, the new code will now causes an uncaught exception and throw to the downstream code.  Therefore, in order to avoid regression or change in behaviour in the existing API, we shouldn't remove the try catch blocks on the exceptions.
Comment 3 Angel Vera CLA 2010-08-23 15:15:13 EDT
Good point Elson. I am committing the code without the removal of the try/catch
Comment 4 Angel Vera CLA 2010-08-23 17:22:19 EDT
Changes committed and released to 32M and HEAD(3.3)
Comment 5 Angel Vera CLA 2010-08-24 14:16:45 EDT
Fixed.
Comment 6 Eclipse Genie CLA 2017-10-11 16:34:29 EDT
New Gerrit change created: https://git.eclipse.org/r/108982