View | Details | Raw Unified | Return to bug 242029
Collapse All | Expand All

(-)model/org/eclipse/jdt/internal/core/SourceMapper.java (-6 / +6 lines)
Lines 498-518 Link Here
498
	private void computeRootPath(IContainer container, HashSet firstLevelPackageNames, boolean hasDefaultPackage, Set set, int sourcePathSegmentCount) {
498
	private void computeRootPath(IContainer container, HashSet firstLevelPackageNames, boolean hasDefaultPackage, Set set, int sourcePathSegmentCount) {
499
		try {
499
		try {
500
			IResource[] resources = container.members();
500
			IResource[] resources = container.members();
501
			boolean hasSubDirectories = false;
501
			for (int i = 0, max = resources.length; i < max; i++) {
502
			loop: for (int i = 0, max = resources.length; i < max; i++) {
503
				IResource resource = resources[i];
502
				IResource resource = resources[i];
504
				if (resource.getType() == IResource.FOLDER) {
503
				if (resource.getType() == IResource.FOLDER) {
505
					hasSubDirectories = true;
506
					if (firstLevelPackageNames.contains(resource.getName())) {
504
					if (firstLevelPackageNames.contains(resource.getName())) {
507
						IPath fullPath = container.getFullPath();
505
						IPath fullPath = container.getFullPath();
508
						IPath rootPathEntry = fullPath.removeFirstSegments(sourcePathSegmentCount).setDevice(null);
506
						IPath rootPathEntry = fullPath.removeFirstSegments(sourcePathSegmentCount).setDevice(null);
509
						set.add(rootPathEntry);
507
						if (rootPathEntry.segmentCount() >= 1) {
510
						break loop;
508
							set.add(rootPathEntry);
509
						}
510
						computeRootPath((IFolder) resource, firstLevelPackageNames, hasDefaultPackage, set, sourcePathSegmentCount);
511
					} else {
511
					} else {
512
						computeRootPath((IFolder) resource, firstLevelPackageNames, hasDefaultPackage, set, sourcePathSegmentCount);
512
						computeRootPath((IFolder) resource, firstLevelPackageNames, hasDefaultPackage, set, sourcePathSegmentCount);
513
					}
513
					}
514
				}
514
				}
515
				if (i == max - 1 && !hasSubDirectories && hasDefaultPackage) {
515
				if (i == max - 1 && hasDefaultPackage) {
516
					// check if one member is a .java file
516
					// check if one member is a .java file
517
					boolean hasJavaSourceFile = false;
517
					boolean hasJavaSourceFile = false;
518
					for (int j = 0; j < max; j++) {
518
					for (int j = 0; j < max; j++) {

Return to bug 242029