Community
Participate
Working Groups
1. JUnit setup 2. Add folder that contains a dot (e.g. "com.ibm") to junit.test (in navigator or packages view) ==> folder com.ibm not visible in packages view Add resource and/or java file to the folder ==> folder and files not visible in packages view If the test case is done with a folder without a dot then the folder is visible NOTES: EG (4/29/2001 3:25:49 PM) some more facts: 1) adding a package name a.b.c in the packages view with the New Package wizard works as expected 2) in a project with source folders you can add com.ibm as an ordinary folder to the project using the basic New Folder wizard. 3) in a project with source folders adding a new folder a.b.c to a package fragment root shows the behaviour that DM described above, i.e., the folder isn't visible, it exists and shows up in the packages view. It isn't a notification problem, the Java Model doesn't surface these folders. Notice once the Java Model surfaces these folders we have the problem how to distinguish a folder "a.b.c" from a\b\c that shows up as a.b.c. We would have to use some escape mechanism, e.g., a\.b\.c However, before addressing this UI issue we first need to get such folders from the Java model. See also: 1GCP6M8: ITPJUI:WINNT - Adding a file without dot not visible in package Moving to JCORE PM (4/30/2001 10:57:56 AM) Those were filtered out from package fragment creation code. Handling them will be tricky, given there is no way to distinguish them afterwards unless going back to the underlying resource. When not filtering them out, the package becomes visible, but then adding one class in it becomes tricky, given the model tries to recreate the proper folder structure (a/b/c from a.b.c)... Then this is causing duplicate elements, because a/b/c and a.b.c are producing elements named 'a.b.c'. What's the point ? How do we want to handle these ? Enabling the creation of packages with dot names: org.eclipse.jdt.internal.core.PackageFragmentRoot.computeFolderChildren(IContainer, String, Vector) /** * Starting at this folder, create package fragments and add the fragments to the collection * of children. * * @exception JavaModelException The resource associated with this package fragment does not exist */ protected void computeFolderChildren(IContainer folder, String prefix, Vector vChildren) throws JavaModelException { IPackageFragment pkg = getPackageFragment(prefix); vChildren.addElement(pkg); try { IPath outputLocationPath = getJavaProject().getOutputLocation(); IResource[] members = folder.members(); for (int i = 0, max = members.length; i < max; i++) { IResource member = members[i]; if (member.getType() == IResource.FOLDER) { String newPrefix; if (prefix.length() == 0) { newPrefix = member.getName(); } else { newPrefix = prefix + "." + member.getName(); } // eliminate binary output only if nested inside direct subfolders if (!member.getFullPath().equals(outputLocationPath)) { computeFolderChildren((IFolder) member, newPrefix, vChildren); } } } } catch(IllegalArgumentException e){ throw new JavaModelException(e, IJavaModelStatusConstants.ELEMENT_DOES_NOT_EXIST); // could be thrown by ElementTree when path is not found } catch (CoreException e) { throw new JavaModelException(e); } }
PRODUCT VERSION: SDK 0.046
Is this one resolved with latest delta processing algorithm ?
The current behavior is that the addition of dot-named folder is reported as the non-java resource addition. Files added to this folder are considered non- java resources (even if their suffix is .java). This behavior is correct since a dot-named folder is not a valid name for a package. Closing.
This PR is not fixed. If JCore does not consider it a bug then it is a UI bug: I can handle the fact that folder names with '.' are not valid package names but then the folders have to show up immediately as resource folders in the Packages view.
Sorry, you're right, this bug is not entirely fixed. The delta processor now correctly reports a resource delta for addition of a dot-named folder, BUT the non-java resources of packages or package fragment roots don't include the dot- named folder. This must be fixed by JDT Core.
Now correctly add dot-named folders to the non-java resources of IPackageFragments and IPackageFragmentRoots.
*** Bug 6491 has been marked as a duplicate of this bug. ***
*** Bug 3314 has been marked as a duplicate of this bug. ***