Bug 15877 Jar export wizard (driver 020502)
Hi, I really don't know if this is the correct category for this bug. Sorry if I am at the wrong place. The option of saving the "export to jar" wizard settings on a file is really good. The only problem is that if I activate the Jar wizard again (not using the jardesc file) to do an export that I don't to create a jardesc for, all the previous settings are loaded again, including the jardesc file name. Since this information is on the 2nd or 3rd page, I got it rewrite without knowing it. Maybe the export wizard should keep the previous settings only if a jardesc is NOT created (afterall why do I need then persisted between wizard activations if I saved the information?).
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
*/
	boolean isClassFile(IResource file) {
		return file != null
			&& file.getType() == IFile.FILE
			&& file.getFileExtension() != null
			&& file.getFileExtension().equalsIgnoreCase("class"); 
	}
	/*
	 * Builds and returns a map that has the class files
	 * for each java file in a given directory
	 */
	private Map buildJavaToClassMap(IContainer container) throws CoreException {
		if (!isCompilerGeneratingSourceFileAttribute())
			return null;
		
		if (container == null || !container.isAccessible())
			return new HashMap(0);
		/*
		 * XXX: Bug 6584: Need a way to get class files for a java file (or CU)
		 */
		org.eclipse.jdt.internal.compiler.classfmt.ClassFileReader cfReader;
		IResource[] members= container.members();
		Map map= new HashMap(members.length);
		for (int i= 0;  i < members.length; i++) {
			if (isClassFile(members[i])) {
				IFile classFile= (IFile)members[i];
				try {
					cfReader= org.eclipse.jdt.internal.compiler.classfmt.ClassFileReader.read(classFile.getLocation().toFile());
				} catch (org.eclipse.jdt.internal.compiler.classfmt.ClassFormatException ex) {
					addWarning(JarPackagerMessages.getFormattedString("JarFileExportOperation.invalidClassFileFormat", classFile.getLocation().toFile()), ex);