Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 326015
Collapse All | Expand All

(-)earproject/org/eclipse/jst/j2ee/componentcore/util/EARVirtualComponent.java (-6 / +5 lines)
Lines 161-180 Link Here
161
			for (int i = 0; i < members.length; i++) {
161
			for (int i = 0; i < members.length; i++) {
162
				if (IVirtualResource.FILE == members[i].getType()) {
162
				if (IVirtualResource.FILE == members[i].getType()) {
163
					if(folder.isDynamicComponent((IVirtualFile)members[i])){
163
					if(folder.isDynamicComponent((IVirtualFile)members[i])){
164
						IPath archiveFullPath = new Path(members[i].getRuntimePath().toString());
164
						String archiveName = members[i].getRuntimePath().toString().substring(1);
165
						boolean shouldInclude = true;
165
						boolean shouldInclude = true;
166
						for (int j = 0; j < hardReferences.size() && shouldInclude; j++) {
166
						for (int j = 0; j < hardReferences.size() && shouldInclude; j++) {
167
							IVirtualReference tmpRef = ((IVirtualReference) hardReferences.get(j));
167
							String tempArchiveName = ((IVirtualReference) hardReferences.get(j)).getArchiveName();
168
							IPath tmpFullPath = tmpRef.getRuntimePath().append(tmpRef.getArchiveName());
168
							if (null != tempArchiveName && tempArchiveName.equals(archiveName)) {
169
							if( tmpFullPath.equals(archiveFullPath))
170
								shouldInclude = false;
169
								shouldInclude = false;
170
							}
171
						}
171
						}
172
						if (shouldInclude) {
172
						if (shouldInclude) {
173
							IResource iResource = members[i].getUnderlyingResource();
173
							IResource iResource = members[i].getUnderlyingResource();
174
							IVirtualComponent dynamicComponent = ComponentCore.createArchiveComponent(earComponent.getProject(), VirtualArchiveComponent.LIBARCHIVETYPE + iResource.getFullPath().toString());
174
							IVirtualComponent dynamicComponent = ComponentCore.createArchiveComponent(earComponent.getProject(), VirtualArchiveComponent.LIBARCHIVETYPE + iResource.getFullPath().toString());
175
							IVirtualReference dynamicRef = ComponentCore.createReference(earComponent, dynamicComponent);
175
							IVirtualReference dynamicRef = ComponentCore.createReference(earComponent, dynamicComponent);
176
							dynamicRef.setArchiveName(archiveFullPath.lastSegment());
176
							dynamicRef.setArchiveName(archiveName);
177
							dynamicRef.setRuntimePath(archiveFullPath.removeLastSegments(1));
178
							if (null == dynamicReferences) {
177
							if (null == dynamicReferences) {
179
								dynamicReferences = new ArrayList();
178
								dynamicReferences = new ArrayList();
180
							}
179
							}

Return to bug 326015