Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 311732 - IVirtualComponent.getReferences() problem with legacy metadata
Summary: IVirtualComponent.getReferences() problem with legacy metadata
Status: RESOLVED DUPLICATE of bug 311208
Alias: None
Product: WTP Common Tools
Classification: WebTools
Component: wst.common (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.2 RC1   Edit
Assignee: Chuck Bridgham CLA
QA Contact: Carl Anderson CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-05 10:21 EDT by Chuck Bridgham CLA
Modified: 2010-05-05 20:31 EDT (History)
0 users

See Also:
ccc: review+


Attachments
patch (1.39 KB, patch)
2010-05-05 15:54 EDT, Chuck Bridgham CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chuck Bridgham CLA 2010-05-05 10:21:10 EDT
Recently it was discovered on older workspaces, the component references didn't capture the "archiveName" element, and the method above didn't protect itself in this scenario.

The following exceptions were being thrown because the archive wasn't found  

!ENTRY org.eclipse.wst.common.modulecore 4 0 2010-05-05 10:09:16.078
!MESSAGE 
!STACK 0
java.lang.NullPointerException
	at org.eclipse.wst.common.componentcore.internal.util.VirtualReferenceUtilities.getDefaultArchiveName(VirtualReferenceUtilities.java:71)
	at org.eclipse.wst.common.componentcore.internal.util.VirtualReferenceUtilities.ensureReferencesHaveNames(VirtualReferenceUtilities.java:60)
	at org.eclipse.jst.j2ee.componentcore.util.EARVirtualComponent.customizeCreatedReference(EARVirtualComponent.java:97)
	at org.eclipse.wst.common.componentcore.internal.resources.VirtualComponent.getReferences(VirtualComponent.java:396)
	at org.eclipse.jst.j2ee.componentcore.util.EARVirtualComponent.getHardReferences(EARVirtualComponent.java:86)
	at org.eclipse.jst.j2ee.componentcore.util.EARVirtualComponent.getReferences(EARVirtualComponent.java:180)
	at org.eclipse.jst.j2ee.componentcore.util.EARVirtualComponent.getReferences(EARVirtualComponent.java:209)
	at org.eclipse.wst.common.componentcore.internal.builder.DependencyGraphImpl$GraphUpdateJob$1.run(DependencyGraphImpl.java:352)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at
Comment 1 Chuck Bridgham CLA 2010-05-05 15:54:13 EDT
Created attachment 167216 [details]
patch
Comment 2 Chuck Bridgham CLA 2010-05-05 15:55:25 EDT
Attached patch that correctly places a brace around two calls that should only be called when the reference has proper archive names
Comment 3 Carl Anderson CLA 2010-05-05 17:09:20 EDT
I approve of this patch.
Comment 4 Chuck Bridgham CLA 2010-05-05 20:31:47 EDT
oops... I didn't realize this was just fixed by bug 311208

*** This bug has been marked as a duplicate of bug 311208 ***