Is it possible to fix all the package names in a given folder in IntelliJ?

If files are manually imported into IntelliJ, and their package names are all wrong (including the sub-folders), how can I mass fix the package names?

This has caused me a lot of grief so far....

moving to a package or renaming a package

This has to be a bug.

Example:

If I am on a package in the project explorer, and rename the package, say it is:

com.example.xml.xml

Now I want to change this (and all the files under it) to:

com.example.xml

I can't seem to do it!

When it says "rename package com.example.xml.xml to":

If I enter "com.example.xml" it won't work. I'm not sure what it is going on, I have spent a over an hour trying this as I have more files to import/fix.

Edit
Report