Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 155276 Details for
Bug 297882
SingleRoot should be allowed for projects without src folder
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
updated_patch
patch.txt (text/plain), 3.90 KB, created by
Jason Peterson
on 2010-01-04 15:39:29 EST
(
hide
)
Description:
updated_patch
Filename:
MIME Type:
Creator:
Jason Peterson
Created:
2010-01-04 15:39:29 EST
Size:
3.90 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jst.j2ee >Index: j2eecreation/org/eclipse/jst/j2ee/project/SingleRootUtil.java >=================================================================== >RCS file: /cvsroot/webtools/jeetools/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/project/SingleRootUtil.java,v >retrieving revision 1.3 >diff -u -r1.3 SingleRootUtil.java >--- j2eecreation/org/eclipse/jst/j2ee/project/SingleRootUtil.java 2 Dec 2009 20:15:40 -0000 1.3 >+++ j2eecreation/org/eclipse/jst/j2ee/project/SingleRootUtil.java 4 Jan 2010 20:39:34 -0000 >@@ -176,6 +176,19 @@ > return getStatus(); > } > >+ if (resourceMaps.size() == 1) { >+ ComponentResource mapping = (ComponentResource)resourceMaps.get(0); >+ if (isRootMapping(mapping)) { >+ IResource sourceResource = getProject().findMember(mapping.getSourcePath()); >+ if (sourceResource != null && sourceResource.exists()) { >+ if (sourceResource instanceof IContainer && !isSourceContainer((IContainer) sourceResource)) { >+ reportStatus(ISingleRootStatus.SINGLE_ROOT_CONTAINER_FOUND, (IContainer) sourceResource); >+ return getStatus(); >+ } >+ } >+ } >+ } >+ > if (JavaEEProjectUtilities.isDynamicWebProject(getProject())) { > //validate web projects for single root > validateWebProject(resourceMaps); >@@ -373,9 +386,8 @@ > for (int i=0; i < resourceMaps.size(); i++) { > ComponentResource resourceMap = (ComponentResource) resourceMaps.get(i); > // Verify it maps to "/" for the content root >- IPath runtimePath = resourceMap.getRuntimePath(); >- if (!runtimePath.equals(Path.ROOT)) { >- reportStatus(ISingleRootStatus.RUNTIME_PATH_NOT_ROOT, runtimePath); >+ if (!isRootMapping(resourceMap)) { >+ reportStatus(ISingleRootStatus.RUNTIME_PATH_NOT_ROOT, resourceMap.getRuntimePath()); > if (VALIDATE_FLAG == CANCEL) return false; > } > >@@ -395,6 +407,13 @@ > return true; > } > >+ private boolean isRootMapping(ComponentResource map) { >+ // Verify it maps to "/" for the content root >+ if (map.getRuntimePath().equals(Path.ROOT)) >+ return true; >+ return false; >+ } >+ > /** > * Ensure the default web setup is correct with one resource map and any number of java > * resource maps to WEB-INF/classes >@@ -404,13 +423,6 @@ > */ > private boolean hasDefaultWebResourceMappings(List resourceMaps) { > int rootValidMaps = 0; >- int javaValidRoots = 0; >- >- // If there aren't at least 2 maps, return false >- if (VALIDATE_FLAG == INCLUDE_FIRST_ERROR && resourceMaps.size() < 2) { >- reportStatus(ISingleRootStatus.ATLEAST_1_RESOURCE_MAP_MISSING); >- return false; >- } > > IPath webInfClasses = new Path(J2EEConstants.WEB_INF_CLASSES).makeAbsolute(); > for (int i = 0; i < resourceMaps.size(); i++) { >@@ -420,16 +432,13 @@ > IResource sourceResource = getProject().findMember(sourcePath); > > // Verify if the map is for the content root >- if (runtimePath.equals(Path.ROOT)) { >+ if (isRootMapping(resourceMap)) { > rootValidMaps++; > } > // Verify if the map is for a java src folder and is mapped to "WEB-INF/classes" > else if (runtimePath.equals(webInfClasses)) { > if (sourceResource != null && sourceResource.exists()) { >- if (sourceResource instanceof IContainer && isSourceContainer((IContainer) sourceResource)) { >- javaValidRoots++; >- } >- else { >+ if (sourceResource instanceof IContainer && !isSourceContainer((IContainer) sourceResource)) { > reportStatus(ISingleRootStatus.SOURCE_NOT_JAVA_CONTAINER, sourcePath); > } > } >@@ -450,11 +459,7 @@ > else if (rootValidMaps > 1) { > reportStatus(ISingleRootStatus.ONLY_1_CONTENT_ROOT_ALLOWED); > } >- if (VALIDATE_FLAG == CANCEL) return false; > } >- if (javaValidRoots < 1) { >- reportStatus(ISingleRootStatus.ATLEAST_1_JAVA_SOURCE_REQUIRED); >- } > return VALIDATE_FLAG == CANCEL ? false : true; > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 297882
:
154508
| 155276