Repository navigation
Conversation
|
@kwin can you sync with master? Then we can run ci again. |
Emit conflicting bundle id and add countermeasure in case conflicting bundle is already uninstalled.
6b82ac9 to
8865bc0
Compare
|
@paulrutter Done, now TCK builds are successful as well. |
|
Alright, i'll try to take another look soon and hopefully we can take this along with next 8.0.0 release (JDK 25). |
| throw new ResolveException("Singleton conflict.", br, null); | ||
| BundleRevision conflictingRevision = findConflictingSingleton(br); | ||
| throw new ResolveException( | ||
| "Singleton conflict for Bundle-SymbolicName " + br.getSymbolicName() |
There was a problem hiding this comment.
The message always says "Another bundle is already providing this singleton BSN", but findConflictingSingleton can return null, e.g. when br was not selected because a resolver hook whitelist filtered it out, or it lost to a higher version in the same resolve. The text then reads "...singleton BSN: ?.", which is wrong and misleading. Consider different wording for the null case.
| String details = "[id=" + conflictingBundle.getBundleId() + "]"; | ||
| if (conflictingBundle.getState() == Bundle.UNINSTALLED) | ||
| { | ||
| details += ". This bundle is already uninstalled. Call refreshPackages() to remove it from the framework."; |
There was a problem hiding this comment.
For an uninstalled conflicting bundle this string already ends with a period, and the caller appends another one, so the message ends in "..". Also, refreshPackages() is the deprecated PackageAdmin API; FrameworkWiring.refreshBundles() is the current one.
| return m_selectedSingletons.contains(br); | ||
| } | ||
|
|
||
| private synchronized BundleRevision findConflictingSingleton(BundleRevision br) |
There was a problem hiding this comment.
No tests cover the new message or helpers. The null, uninstalled and normal conflict branches are all unexercised, so a later change to the message format or to singleton selection could break them silently.
Emit conflicting bundle id and add countermeasure in case conflicting bundle is already uninstalled.