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

Bug 353629

Summary: [content assist] Custom tag file attributes proposal "mixing" attributes from other tag files inside the same jar
Product: [WebTools] WTP Source Editing Reporter: Andre Albino Pereira <andreptb>
Component: jst.jspAssignee: Andre Albino Pereira <andreptb>
Status: RESOLVED FIXED QA Contact: Nick Sandonato <nsand.dev>
Severity: normal    
Priority: P3 CC: thatnitind
Version: 3.3   
Target Milestone: 3.3.1   
Hardware: All   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
Patch to address the problem of loading all tag-files inside the same jar, "mixing" meta data information. nsand.dev: iplog+

Description Andre Albino Pereira CLA 2011-08-02 14:11:13 EDT
Build Identifier: 20110615-0604

When using ctrl+space to view attributes proposals in a tag-file declaration in the jsp editor it should show only the attributes referenced in the tag-file. Inspecting "org.eclipse.jst.jsp.core.internal.contentmodel.tld.CMDocumentFactoryTLD.createElementDeclaration(CMDocumentImpl, Element, String)", one could see that when the tag-file is inside a jar, it tries to load all tag-files from that jar. That seems to be incorrect, since it should load only the tag-file referenced in the third argument "path" from "createElementDeclaration". By loading all tag-files using "org.eclipse.jst.jsp.core.internal.contentmodel.tld.CMDocumentFactoryTLD.loadTagFile(CMElementDeclarationImpl, IFile, boolean, InputStream)", the attribute information (and all other metadata information) of all tag-files is mixed/overwritten in the same instance of "org.eclipse.jst.jsp.core.internal.contentmodel.tld.CMElementDeclarationImpl", instead of containing only the information associated with the tag-file referenced by "path" argument of "createElementDeclaration".

Reproducible: Always

Steps to Reproduce:
1. Add a external jar to your Web project containing 2 custom tag-files with different attributes.
2. Create a jsp and declare one the tags.
3. Press ctrl+space and inspect the attributes proposed by the content assist, all the attributes from tag 1 and 2 will show.
Comment 1 Andre Albino Pereira CLA 2011-08-02 14:15:56 EDT
Created attachment 200754 [details]
Patch to address the problem of loading all tag-files inside the same jar, "mixing" meta data information.
Comment 2 Nick Sandonato CLA 2011-08-08 17:45:15 EDT
Thank you very much for your patch, Andre! I've released the changes.
Comment 3 Andre Albino Pereira CLA 2011-08-08 19:31:58 EDT
(In reply to comment #2)
> Thank you very much for your patch, Andre! I've released the changes.

You're welcome!