Closed mbien closed 1 month ago
I am no osgi expert but this would be a plausible explanation:
Lookup.getDefault().lookupAll(RepositoryIndexerImplementation.class))
NexusRepositoryIndexerImpl
if it wasn't used yet, osgi classloading is essentially disabled and will now throw Bundle "reference:file:ide/modules/com-google-gson.jar" has been uninstalled
so this is mostly harmless, lazy loading SMO is an easy fix and should have no side effects
thanks for the review, I will try to split cleanup the rest from now on again.
My opinion about misuse of records for final classes with immutable fields:
if its a private or package private non-API utility, I would personally go with whatever is most concise or reads best. There absolutely are problems with record overuse, but this is often a problem in API. Interfaces on top and records on the bottom can look convenient, but as soon you need an additional field which can't be passed through the canonical constructor you designed yourself into a corner and have to recompute state in methods again and again.
So I do agree that record overuse can cause problems, but I think in situations where you can change back to a final class at any point in future - it is no real problem. You get a good toString()
for free which helps when debugging.
var
overuse however... does actually obfuscate code since it hides types entirely, now add inline hints again and it often uses more space than without var
- but you know that this is my personal pet peeve ;)
So I noticed since https://github.com/apache/netbeans/pull/7569 this exception when NB is started and closed before the maven indexer is initialized:
I am not completely sure why this happens. The gson wrapper can be found just fine when
NexusRepositoryIndexerImpl
is initialized normally, but when it is loaded from for the first time https://github.com/apache/netbeans/blob/1b31400eaaa7d118ebb7c2b053f0b96c95f987e3/java/maven.indexer/src/org/netbeans/modules/maven/indexer/OnStop.java#L48-L52 it causes the exception. Lazy loading SMO fixes it.