You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have think more about IMavenProjectFacade#getMavenProject() now, look for usages in m2e code and how it behaves and came to the conclusion that it is actually bad to have this in the API (and thus like to deprecate/for removal) it.
From all 37 reference in the codebase only 8 actually checking for null the rest sooner or later de-reference the project and will fail if null is returned.
From the few actually checking for null, this almost always results in "nothing" happens even though the user would expect something to happen
As whether or not a project is cached is not deterministic, there are only two choices:
The project is actually loaded at this point (because from the callstack / context) and it doesn't matter what method is called
Whether or not the code do useful things or even runs into a NPE is completely random and depends among other things how many projects are actively used in the workspace
Because of this I think:
We should deprecate it from the public API, this method is just confusing and of less use for consumers (but might be of rare use by internal code that carefully is crafted to react fro the consequences)
Probably check if we should cache some more data in the facade if it is useful for consumers so they don't need to query the maven project at all
Improve general performance / memory footprint of m2e so we can hold more data in the cache and doing caching smarter (e.g as suggested by @mickaelistria here ProjectRegistryManager and caching #1032 (comment)) so even if consumers need the model it is most probably already cached.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I have think more about
IMavenProjectFacade#getMavenProject()
now, look for usages in m2e code and how it behaves and came to the conclusion that it is actually bad to have this in the API (and thus like to deprecate/for removal) it.null
is returned.null
, this almost always results in "nothing" happens even though the user would expect something to happenAs whether or not a project is cached is not deterministic, there are only two choices:
Because of this I think:
Beta Was this translation helpful? Give feedback.
All reactions