The bug is that we parse all URLs matching the provided resource name, but only return the PU names from the last URL that was parsed. We should be saving the results after each time we parse a URL and returning ALL results.
In addition to the bug fix I added some error detection. If there are persistence unit name collisions for the provided resource name, a WARNING message will be logged. See below for a snippet from a test run.
[java] 297 WARN [main] openjpa.Persistence - The persistence unit "jpa.connection-pool" was found in the following resources "[file:/C:/jpa/workspace-samples/projects/j
pa.connection.pool/bin/META-INF/persistence.xml, jar:file:/C:/jpa/workspace-samples/projects/lib/test-bad.jar!/META-INF/persistence.xml]". Please correct the problem as it may
have unexpected results.