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 154508 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]
patch
patch.txt (text/plain), 5.60 KB, created by
Jason Peterson
on 2009-12-15 13:32:59 EST
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
Jason Peterson
Created:
2009-12-15 13:32:59 EST
Size:
5.60 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 15 Dec 2009 18:16:18 -0000 >@@ -176,6 +176,17 @@ > return getStatus(); > } > >+ if (resourceMaps.size() == 1) { >+ ComponentResource mapping = (ComponentResource)resourceMaps.get(0); >+ if (isRootMapping(mapping)) { >+ IResource sourceResource = getProject().findMember(mapping.getSourcePath()); >+ 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 +384,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 +405,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 +421,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 +430,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 +457,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; > } > >Index: j2eecreation/org/eclipse/jst/j2ee/project/ISingleRootStatus.java >=================================================================== >RCS file: /cvsroot/webtools/jeetools/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/project/ISingleRootStatus.java,v >retrieving revision 1.2 >diff -u -r1.2 ISingleRootStatus.java >--- j2eecreation/org/eclipse/jst/j2ee/project/ISingleRootStatus.java 18 Nov 2009 22:38:28 -0000 1.2 >+++ j2eecreation/org/eclipse/jst/j2ee/project/ISingleRootStatus.java 15 Dec 2009 18:16:18 -0000 >@@ -37,26 +37,22 @@ > > public static final int JAVA_OUTPUT_NOT_WEBINF_CLASSES = 72; > >- public static final int ATLEAST_1_RESOURCE_MAP_MISSING = 73; >+ public static final int NO_RESOURCE_MAPS_FOUND = 73; > >- public static final int NO_RESOURCE_MAPS_FOUND = 74; >+ public static final int ONE_CONTENT_ROOT_REQUIRED = 74; > >- public static final int ONE_CONTENT_ROOT_REQUIRED = 75; >+ public static final int RUNTIME_PATH_NOT_ROOT = 75; > >- public static final int ATLEAST_1_JAVA_SOURCE_REQUIRED = 76; >+ public static final int SOURCE_NOT_JAVA_CONTAINER = 76; > >- public static final int RUNTIME_PATH_NOT_ROOT = 77; >+ public static final int RUNTIME_PATH_NOT_ROOT_OR_WEBINF_CLASSES = 77; > >- public static final int SOURCE_NOT_JAVA_CONTAINER = 78; >- >- public static final int RUNTIME_PATH_NOT_ROOT_OR_WEBINF_CLASSES = 79; >- >- public static final int ONLY_1_CONTENT_ROOT_ALLOWED = 80; >+ public static final int ONLY_1_CONTENT_ROOT_ALLOWED = 78; > >- public static final int EXPLICITLY_DISABLED = 81; >- >- public static final int CONSUMABLE_REFERENCES_FOUND = 82; >+ public static final int EXPLICITLY_DISABLED = 79; > >+ public static final int CONSUMABLE_REFERENCES_FOUND = 80; >+ > > /** > * Returns the path with which the status is associated.
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