Schizofrenic package version creation
Lukas Krejci
lkrejci at redhat.com
Thu Mar 3 11:03:34 UTC 2011
For some strange reason, we have 2 methods for creating a new package version.
ContentManagerRemote.createPackageVersion() and
ContentManagerLocal.getUploadedPackageVersion()
The only important semantical difference between these two methods, I think,
is this:
createPackageVersion doesn't update the bits or any other details of the
package from the provided inputstream if the package version already exists,
whereas getUploadPackageVersion updates them.
This is quite important difference, yet these two methods are used seemingly
interchangeably throughout the code.
(the other difference is that getUploadedPackageVersion() needs to be provided
with additional details like SHA, etc., whereas createPackageVersion()
computes them.)
I'd suggest we check all the usages of these two methods with the above
difference in mind.
For example ResourceFactoryManagerBean.createResource() chooses one or the
other of the above methods based on fact if the caller provided a map with the
additional details which I think is wrong.
I'm not sure I know all the consequences of changing the behavior of any of
these methods, so I'm asking here.
Cheers,
Lukas
More information about the rhq-devel
mailing list