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 338751
Collapse All | Expand All

(-)src/org/eclipse/jst/jsp/core/internal/util/FacetModuleCoreSupportDelegate.java (-19 / +37 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2007 IBM Corporation and others.
2
 * Copyright (c) 2007, 2011 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse License v1.0
4
 * are made available under the terms of the Eclipse License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 10-17 Link Here
10
 *******************************************************************************/
10
 *******************************************************************************/
11
package org.eclipse.jst.jsp.core.internal.util;
11
package org.eclipse.jst.jsp.core.internal.util;
12
12
13
import org.eclipse.core.resources.IContainer;
13
import org.eclipse.core.resources.IFile;
14
import org.eclipse.core.resources.IFile;
14
import org.eclipse.core.resources.IProject;
15
import org.eclipse.core.resources.IProject;
16
import org.eclipse.core.resources.IResource;
15
import org.eclipse.core.resources.ResourcesPlugin;
17
import org.eclipse.core.resources.ResourcesPlugin;
16
import org.eclipse.core.runtime.CoreException;
18
import org.eclipse.core.runtime.CoreException;
17
import org.eclipse.core.runtime.IPath;
19
import org.eclipse.core.runtime.IPath;
Lines 21-26 Link Here
21
import org.eclipse.wst.common.componentcore.ModuleCoreNature;
23
import org.eclipse.wst.common.componentcore.ModuleCoreNature;
22
import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
24
import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
23
import org.eclipse.wst.common.componentcore.resources.IVirtualFile;
25
import org.eclipse.wst.common.componentcore.resources.IVirtualFile;
26
import org.eclipse.wst.common.componentcore.resources.IVirtualFolder;
24
import org.eclipse.wst.common.componentcore.resources.IVirtualResource;
27
import org.eclipse.wst.common.componentcore.resources.IVirtualResource;
25
import org.eclipse.wst.common.project.facet.core.IFacetedProject;
28
import org.eclipse.wst.common.project.facet.core.IFacetedProject;
26
import org.eclipse.wst.common.project.facet.core.IProjectFacet;
29
import org.eclipse.wst.common.project.facet.core.IProjectFacet;
Lines 156-180 Link Here
156
			return null;
159
			return null;
157
160
158
		if (basePath.segmentCount() > 1) {
161
		if (basePath.segmentCount() > 1) {
159
			IFile baseFile = ResourcesPlugin.getWorkspace().getRoot().getFile(basePath);
162
			IResource baseResource = ResourcesPlugin.getWorkspace().getRoot().findMember(basePath);
160
			IVirtualResource[] virtualResources = ComponentCore.createResources(baseFile);
163
			if (baseResource != null) {
161
			for (int i = 0; i < virtualResources.length; i++) {
164
				IVirtualResource[] virtualResources = ComponentCore.createResources(baseResource);
162
				IPath baseRuntimePath = virtualResources[i].getRuntimePath();
165
				for (int i = 0; i < virtualResources.length; i++) {
163
				IPath referenceRuntimePath = null;
166
					IPath referenceRuntimePath = null;
164
				if (reference.startsWith(SLASH)) {
167
					if (reference.startsWith(SLASH)) {
165
					referenceRuntimePath = new Path(reference);
168
						referenceRuntimePath = new Path(reference);
166
				}
169
					}
167
				else {
170
					else {
168
					referenceRuntimePath = baseRuntimePath.removeLastSegments(1).append(reference);
171
						IPath baseRuntimePath = virtualResources[i].getRuntimePath();
169
				}
172
						referenceRuntimePath = baseRuntimePath.removeLastSegments(1).append(reference);
170
				IVirtualFile virtualFile = ComponentCore.createFile(project, referenceRuntimePath);
173
					}
171
				if (virtualFile != null && virtualFile.exists()) {
174
					
172
					IFile[] underlyingFiles = virtualFile.getUnderlyingFiles();
175
					IVirtualFile virtualFile = ComponentCore.createFile(project, referenceRuntimePath);
173
					for (int j = 0; j < underlyingFiles.length; j++) {
176
					if (virtualFile != null && virtualFile.exists()) {
174
						if (underlyingFiles[j].getProject().equals(project) && underlyingFiles[j].exists()) {
177
						IFile[] underlyingFiles = virtualFile.getUnderlyingFiles();
175
							return underlyingFiles[j].getFullPath();
178
						for (int j = 0; j < underlyingFiles.length; j++) {
176
						}
179
							if (underlyingFiles[j].getProject().equals(project) && underlyingFiles[j].isAccessible()) {
180
								return underlyingFiles[j].getFullPath();
181
							}
177
182
183
						}
184
					}
185
					else {
186
						// http://bugs.eclipse.org/338751 
187
						IVirtualFolder virtualFolder = ComponentCore.createFolder(project, referenceRuntimePath);
188
						if (virtualFolder != null && virtualFolder.exists()) {
189
							IContainer[] underlyingFolders = virtualFolder.getUnderlyingFolders();
190
							for (int j = 0; j < underlyingFolders.length; j++) {
191
								if (underlyingFolders[j].getProject().equals(project) && underlyingFolders[j].isAccessible()) {
192
									return underlyingFolders[j].getFullPath();
193
								}
194
							}
195
						}
178
					}
196
					}
179
				}
197
				}
180
			}
198
			}
(-)src/org/eclipse/jst/jsp/core/taglib/ProjectDescription.java (-4 / +14 lines)
Lines 663-668 Link Here
663
663
664
	private String fSaveStateFilename;
664
	private String fSaveStateFilename;
665
665
666
	/**
667
	 * String->ITaglibRecord
668
	 */
666
	Hashtable fTagDirReferences;
669
	Hashtable fTagDirReferences;
667
670
668
	Hashtable fTLDReferences;
671
	Hashtable fTLDReferences;
Lines 1737-1759 Link Here
1737
			float jspVersion = DeploymentDescriptorPropertyCache.getInstance().getJSPVersion(new Path(basePath));
1740
			float jspVersion = DeploymentDescriptorPropertyCache.getInstance().getJSPVersion(new Path(basePath));
1738
1741
1739
			/**
1742
			/**
1740
			 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=196177 Support
1743
			 * http://bugs.eclipse.org/196177 - Support resolution in flexible
1741
			 * resolution in flexible projects
1744
			 * projects
1742
			 */
1745
			 */
1743
			IPath resourcePath = FacetModuleCoreSupport.resolve(new Path(basePath), reference);
1746
			IPath resourcePath = FacetModuleCoreSupport.resolve(new Path(basePath), reference);
1744
			if (resourcePath.segmentCount() > 1) {
1747
			if (resourcePath.segmentCount() > 1) {
1745
				if (resourcePath.toString().toLowerCase(Locale.US).endsWith(".tld")) { //$NON-NLS-1$ 
1748
				String fileExtension = resourcePath.getFileExtension();
1749
				if (fileExtension != null && fileExtension.toLowerCase(Locale.US).equals("tld")) { //$NON-NLS-1$ 
1746
					IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(resourcePath);
1750
					IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(resourcePath);
1747
					if (file.isAccessible()) {
1751
					if (file.isAccessible()) {
1748
						path = resourcePath.toString();
1752
						path = resourcePath.toString();
1749
					}
1753
					}
1750
				}
1754
				}
1751
				else if (resourcePath.toString().toLowerCase(Locale.US).endsWith(".jar")) { //$NON-NLS-1$ 
1755
				else if (fileExtension != null && fileExtension.toLowerCase(Locale.US).equals("jar")) { //$NON-NLS-1$ 
1752
					IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(resourcePath);
1756
					IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(resourcePath);
1753
					if (file.isAccessible()) {
1757
					if (file.isAccessible()) {
1754
						path = resourcePath.toString();
1758
						path = resourcePath.toString();
1755
					}
1759
					}
1756
				}
1760
				}
1761
				else {
1762
					IFolder folder = ResourcesPlugin.getWorkspace().getRoot().getFolder(resourcePath);
1763
					if (folder.isAccessible()) {
1764
						path = resourcePath.toString();
1765
					}
1766
				}
1757
			}
1767
			}
1758
1768
1759
			LOCK.acquire();
1769
			LOCK.acquire();

Return to bug 338751