[359906] Folder for deployment descriptor field does not display the correct options when there are two or more mappings containing a DD
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ui/JavaEEDeploymentAssemblyAdvancedSectionBuilder.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ui/JavaEEDeploymentAssemblyAdvancedSectionBuilder.java index 02f62c3..e1026e7 100644 --- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ui/JavaEEDeploymentAssemblyAdvancedSectionBuilder.java +++ b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ui/JavaEEDeploymentAssemblyAdvancedSectionBuilder.java
@@ -171,8 +171,7 @@ if (fileToLook != null && !fileToLook.equals("")){ //$NON-NLS-1$ IFile ddFile = project.getFile(new Path(mapping).addTrailingSeparator() + fileToLook); if (ddFile != null && ddFile.exists()){ - mappingWithDD.add(mapping); - return new ArrayList<String>(mappingWithDD); + mappingWithDD.add(mapping); } } if (folderToLook != null && !folderToLook.equals("")){ //$NON-NLS-1$ @@ -182,6 +181,10 @@ } } } + if (!mappingWithDD.isEmpty()){ + // return only the mappings that contain a DD file. + return new ArrayList<String>(mappingWithDD); + } return new ArrayList<String>(mappingWithFolder); }