Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 345464 - WorkspaceFileHyperlink throws Null Pointer Exception for tag attribute values which contain path to image file
Summary: WorkspaceFileHyperlink throws Null Pointer Exception for tag attribute values...
Status: RESOLVED FIXED
Alias: None
Product: WTP Source Editing
Classification: WebTools
Component: wst.xml (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 3.3 RC1   Edit
Assignee: Nick Sandonato CLA
QA Contact: Nitin Dahyabhai CLA
URL:
Whiteboard: PMC_approved
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-11 12:31 EDT by Daniel Azarov CLA
Modified: 2011-05-13 13:25 EDT (History)
3 users (show)

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


Attachments
Stack Trace log (5.15 KB, text/plain)
2011-05-11 12:33 EDT, Daniel Azarov CLA
no flags Details
XHTML page (451 bytes, text/plain)
2011-05-11 12:33 EDT, Daniel Azarov CLA
no flags Details
GIF image (1017 bytes, image/gif)
2011-05-11 12:34 EDT, Daniel Azarov CLA
no flags Details
patch (1.48 KB, patch)
2011-05-11 14:23 EDT, Nick Sandonato CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Azarov CLA 2011-05-11 12:31:32 EDT
Build Identifier: I20110310-1119

WorkspaceFileHyperlink throws Null Pointer Exception for tag attribute values contains path to image file, like this: <h:graphicImage value="/img/error.gif" alt="Seam logo"/>

Reproducible: Always

Steps to Reproduce:
1. Create Dynamic Web Project
2. Put home.xhtml to WebContent folder and put error.gif to WebContent/img folder
3. Open home.xhtml file in Web Page Editor
4. Point mouse on "/img/error.gif" tag attribute value and press Ctrl button
FAIL: NullPointerException
Comment 1 Daniel Azarov CLA 2011-05-11 12:33:13 EDT
Created attachment 195388 [details]
Stack Trace log
Comment 2 Daniel Azarov CLA 2011-05-11 12:33:44 EDT
Created attachment 195389 [details]
XHTML page
Comment 3 Daniel Azarov CLA 2011-05-11 12:34:06 EDT
Created attachment 195390 [details]
GIF image
Comment 4 Nick Sandonato CLA 2011-05-11 13:48:46 EDT
Fixed. Thanks for the report and the helpful testcase.
Comment 5 Nick Sandonato CLA 2011-05-11 14:23:37 EDT
Created attachment 195405 [details]
patch
Comment 6 Nick Sandonato CLA 2011-05-11 14:29:20 EDT
Jumped the gun. Need PMC approval.


* 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.

If someone tries to hyperlink on an attribute that references a file in the workspace that does not have a content describer, you'll get an NPE. The example given is a reference to a GIF in the workspace.

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

No

* How has the fix been tested? Is there a test case attached to the bugzilla record? Has a JUnit Test been added?

Ad hoc testing.

* Give a brief technical overview. Who has reviewed this fix?

Because some workspace files do not have a content describer (the attached image is a good example), we must check that one exists before trying to use it to find a default editor.

* What is the risk associated with this fix?

None. It's a null pointer check.
Comment 7 Nick Sandonato CLA 2011-05-11 14:36:57 EDT
Thanks for the review.