Community
Participate
Working Groups
There is a lot of code around storing/retrieving pluginId spread through bundles. Let's add convinient constructors that can retrieve Bundle Symbolic Context for the given class. The fallback without OSGi running will be to get Class FQN. ``` private String identifier(Class<?> caller) { return Optional.ofNullable(FrameworkUtil.getBundle(caller))// .map(b -> b.getSymbolicName())// .orElse(Optional.ofNullable(caller)// .map(c -> c.getName())// .orElse(Status.class.getName())); } ```
New Gerrit change created: https://git.eclipse.org/r/160386
@Lars please have a look, it can help to remove a lot of code around logging
Gerrit change https://git.eclipse.org/r/160386 was merged to [master]. Commit: http://git.eclipse.org/c/equinox/rt.equinox.bundles.git/commit/?id=c2e08d904aad41fd5dedea96d7657233f8dc2ff8
Cool. Alexander, please add to N&N and provide a few Gerrits for using the new API in platform.
This made tonight I-build fail.
New Gerrit change created: https://git.eclipse.org/r/160466
Gerrit change https://git.eclipse.org/r/160466 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.team.git/commit/?id=559aae6dc64f5c2e636de4bcf21f0c477f1ee193
We also got build failures in our code now: IStatus status = new Status(IStatus.ERROR, null, null); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The constructor Status(int, Class<?>, String) is ambiguous Isn't this an incompatible change?
(In reply to Sebastian Ratz from comment #8) > We also got build failures in our code now: > > > IStatus status = new Status(IStatus.ERROR, null, null); > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > The constructor Status(int, Class<?>, String) is ambiguous > > > Isn't this an incompatible change? Using `null` makes it incompatible. I would say this is an API misuse and it should fail with IllegalArgumentException on runtime.
(In reply to Sebastian Ratz from comment #8) > We also got build failures in our code now: > > > IStatus status = new Status(IStatus.ERROR, null, null); > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > The constructor Status(int, Class<?>, String) is ambiguous > > > Isn't this an incompatible change? It is a source code compilation incompatible change, but not a binary incompatible change. Methods get added all the time that introduce compile time ambiguity. If you compile against a new version of a library this is always possible. But your binary compiled against the old library will continue to work with a new version of the library.