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 246291 | Differences between
and this patch

Collapse All | Expand All

(-)j2eeplugin/org/eclipse/jst/j2ee/internal/deployables/J2EEFlexProjDeployable.java (-5 / +36 lines)
Lines 77-82 Link Here
77
	private IContainer[] cachedOutputContainers;
77
	private IContainer[] cachedOutputContainers;
78
	private HashMap cachedOutputMappings;
78
	private HashMap cachedOutputMappings;
79
	private HashMap cachedSourceOutputPairs;
79
	private HashMap cachedSourceOutputPairs;
80
	private boolean isSingleJavaOutputNonSource = false;
80
81
81
	/**
82
	/**
82
	 * Constructor for J2EEFlexProjDeployable.
83
	 * Constructor for J2EEFlexProjDeployable.
Lines 666-671 Link Here
666
	 *    <code>false</code> otherwise
667
	 *    <code>false</code> otherwise
667
	 */
668
	 */
668
	public boolean isSingleRootStructure() {
669
	public boolean isSingleRootStructure() {
670
		isSingleJavaOutputNonSource = false;
669
		StructureEdit edit = null;
671
		StructureEdit edit = null;
670
		try {
672
		try {
671
			edit = StructureEdit.getStructureEditForRead(getProject());
673
			edit = StructureEdit.getStructureEditForRead(getProject());
Lines 720-730 Link Here
720
				}
722
				}
721
				// Ensure there are only source folder component resource mappings to the root content folder
723
				// Ensure there are only source folder component resource mappings to the root content folder
722
				if (isRootResourceMapping(resourceMaps,false)) {
724
				if (isRootResourceMapping(resourceMaps,false)) {
725
					IContainer[] javaOutputFolders = getJavaOutputFolders();
723
					// Verify only one java outputfolder
726
					// Verify only one java outputfolder
724
					if (getJavaOutputFolders().length==1) {
727
					if (javaOutputFolders.length==1) {
725
						// At this point for utility projects, this project is optimized, we can just use the output folder
728
						// By the time we get here we know: for any folders defined as source in the 
726
						if (J2EEProjectUtilities.isUtilityProject(getProject()))
729
						// .component file that they are also java source folders.
730
						if (! isSourceContainer(javaOutputFolders[0].getFullPath())) {
731
							// The single output folder is NOT a source folder so this is single-rooted. Since the
732
							// output folder (something like classes or bin) is not a source folder, JDT copies all files
733
							// (including non Java files) to this folder, so every resource needed at runtime is located 
734
							// in a single directory.
735
							isSingleJavaOutputNonSource = true;
727
							return true;
736
							return true;
737
						} else {
738
// Don't implement at this time. Currently, we claim single-rooted when ejbModlule is the output folder.  However,
739
// we know this is not true because it cannot contain non Java files unless it is the only source folder. But, fixing
740
// at this time would break all current users.
741
//							// The single output folder IS a source folder. If there is more than one source folder
742
//							// then this cannot be single-rooted because JDT does NOTcopy non Java resources into the
743
//							// output folder when it is a source folder.
744
//							if (getSourceContainers().length > 1) {
745
//								return false;
746
//							} else {
747
//								// There is only one source folder and since the output folder is a source folder
748
//								// this is single-rooted.
749
//								return true;
750
//							}
751
						}
752
//						// At this point for utility projects, this project is optimized, we can just use the output folder
753
//						if (J2EEProjectUtilities.isUtilityProject(getProject()))
754
//							return true;
728
						// Verify the java output folder is the same as one of the content roots
755
						// Verify the java output folder is the same as one of the content roots
729
						IPath javaOutputPath = getJavaOutputFolders()[0].getProjectRelativePath();
756
						IPath javaOutputPath = getJavaOutputFolders()[0].getProjectRelativePath();
730
						IContainer[] rootFolders = component.getRootFolder().getUnderlyingFolders();
757
						IContainer[] rootFolders = component.getRootFolder().getUnderlyingFolders();
Lines 832-839 Link Here
832
	 */
859
	 */
833
	private IModuleResource[] getOptimizedMembers() throws CoreException {
860
	private IModuleResource[] getOptimizedMembers() throws CoreException {
834
		if (component != null) {
861
		if (component != null) {
835
			// For java utility modules, we can just use the output container, at this point we know there is only one
862
			if (isSingleJavaOutputNonSource) {
836
			if (J2EEProjectUtilities.isUtilityProject(getProject())) {
863
				// We determined when testing for a single root structure that this project has
864
				// one output folder and that output folder is not a source folder. Since the
865
				// output folder (for example, classes or bin) is not a source folder, JDT copies all files
866
				// (including non Java files) to this folder, so every resource needed at runtime is located 
867
				// in that single output directory.
837
				return getModuleResources(Path.EMPTY, getJavaOutputFolders()[0]);
868
				return getModuleResources(Path.EMPTY, getJavaOutputFolders()[0]);
838
			}
869
			}
839
			// For J2EE modules, we use the contents of the content root
870
			// For J2EE modules, we use the contents of the content root

Return to bug 246291