Bug 28443 organize imports sometimes added to logical packages, sometimes not
20021216 select a logical package - 'organize imports' is not in the context menu select the logical package and another package - organize imports is in the menu
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/OrganizeImportsAction.java
status.add(new Status(Status.ERROR, JavaUI.ID_PLUGIN, Status.ERROR, message, null));					
				} catch (OrganizeImportError e) {
					String message= ActionMessages.getFormattedString("OrganizeImportsAction.multi.error.unresolvable", cuLocation); 
					status.add(new Status(Status.INFO, JavaUI.ID_PLUGIN, Status.ERROR, message, null));
				}
			}
		};
		getShell().getDisplay().syncExec(runnable);
	}
	
				
	private void runOnSingle(ICompilationUnit cu, boolean doResolve, boolean inEditor) {
		if (!ElementValidator.check(cu, getShell(), ActionMessages.getString("OrganizeImportsAction.error.title"), inEditor))  
			return;
		try {
			IPreferenceStore store= PreferenceConstants.getPreferenceStore();
			String[] prefOrder= JavaPreferencesSettings.getImportOrderPreference(store);
			int threshold= JavaPreferencesSettings.getImportNumberThreshold(store);
			boolean ignoreLowerCaseNames= store.getBoolean(PreferenceConstants.ORGIMPORTS_IGNORELOWERCASE);
			
			if (!cu.isWorkingCopy()) {
				IEditorPart editor= EditorUtility.openInEditor(cu);
				if (editor instanceof JavaEditor) {
					fEditor= (JavaEditor) editor;
				}
				
				cu= JavaModelUtil.toWorkingCopy(cu);
			}			
			
			OrganizeImportsOperation op= new OrganizeImportsOperation(cu, prefOrder, threshold, ignoreLowerCaseNames, !cu.isWorkingCopy(), doResolve, createChooseImportQuery());