I have noticed that "Fix Imports" does not sort the imports.

I _think_ NetBeans did sort the imports at some point. But now it's always 
appended at the end - or somewhere near the end.

E.g. I have existing imports like this:

    import javax.portlet.Portlet;
    import javax.portlet.PortletException;
    import javax.portlet.PortletPreferences;
    import javax.portlet.PortletRequestDispatcher;
    import javax.portlet.RenderRequest;
    import javax.portlet.RenderResponse;

    import org.apache.commons.fileupload.FileItem;
    import org.apache.commons.fileupload.FileItemFactory;
    import org.apache.commons.fileupload.disk.DiskFileItemFactory;
    import org.apache.commons.fileupload.portlet.PortletFileUpload;
    import org.apache.commons.lang.StringUtils;

    import com.liferay.portal.kernel.model.Organization;
    import com.liferay.portal.kernel.model.User;
    import com.liferay.portal.kernel.portlet.bridges.mvc.MVCPortlet;
    import com.liferay.portal.kernel.theme.ThemeDisplay;
    import com.liferay.portal.kernel.util.ParamUtil;
    import com.liferay.portal.kernel.util.WebKeys;

    import org.apache.log4j.Logger;
    import org.osgi.service.component.annotations.Component;


Now I add a reference to PortletSession and "Fix Imports" inserts that after 
the com. but before the org. packages:

    import javax.portlet.Portlet;
    import javax.portlet.PortletException;
    import javax.portlet.PortletPreferences;
    import javax.portlet.PortletRequestDispatcher;
    import javax.portlet.RenderRequest;
    import javax.portlet.RenderResponse;

    import org.apache.commons.fileupload.FileItem;
    import org.apache.commons.fileupload.FileItemFactory;
    import org.apache.commons.fileupload.disk.DiskFileItemFactory;
    import org.apache.commons.fileupload.portlet.PortletFileUpload;
    import org.apache.commons.lang.StringUtils;

    import com.liferay.portal.kernel.model.Organization;
    import com.liferay.portal.kernel.model.User;
    import com.liferay.portal.kernel.portlet.bridges.mvc.MVCPortlet;
    import com.liferay.portal.kernel.theme.ThemeDisplay;
    import com.liferay.portal.kernel.util.ParamUtil;
    import com.liferay.portal.kernel.util.WebKeys;
    import javax.portlet.PortletSession;  ----<<<<< Why is this added here? And 
not
    import org.apache.log4j.Logger;
    import org.osgi.service.component.annotations.Component;


Why isn't the new import added after to the group of "javax.portlet.*" imports? 
(or even better after the line with PortletRequestDispatcher)

I tried to turn on and off "Separate Groups" but that doesn't change the 
behaviour.

This is with NetBeans 18 and 19-rc3

Is there a setting I have changed but can't find any more?
Or am I remembering this incorrectly and NetBeans never sorted the imports at 
all?

Regards
Thomas


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@netbeans.apache.org
For additional commands, e-mail: users-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to