The method expects the parent DN. This is not intuitive, it would be better to pass the original DN and to compute the parent within the method.
When passing an empty DN (this happens if the entry's DN only has one name component) a StringIndexOutOfBounds exception is thrown.
There is no check if the package name is valid. For example if an RDN is "ou=External Users" the computed package name is "com.example.External Users".