[
https://issues.apache.org/jira/browse/OODT-686?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13999211#comment-13999211
]
Chris A. Mattmann commented on OODT-686:
----------------------------------------
Rishi, can you put this one on ReviewBoard. I like the patch, but have a few
comments about initializing vectors, versus nulls, etc., that you changed that
I think (a) are orthogonal; and (b) create new memory when it's not needed
(before we get into an if block). RB will help this: http://review.apache.org/
thanks!
> AddProductTypeCliAction should prompt for ProductTypeId
> -------------------------------------------------------
>
> Key: OODT-686
> URL: https://issues.apache.org/jira/browse/OODT-686
> Project: OODT
> Issue Type: Bug
> Components: file manager
> Affects Versions: 0.6
> Environment: 0.7-SNAPSHOT
> Reporter: Rishi Verma
> Assignee: Rishi Verma
> Fix For: 0.7
>
> Attachments: OODT-686.rverma.05-08-2014.patch.txt
>
>
> Currently, the AddProductTypeCliAction [1] breaks (returns
> NullPointerException) when generating a new product type even when all
> required valid arguments are supplied.
> Reproducible steps:
> 1. Navigate to filemgr/bin
> 2. Issue: ./filemgr-client -op -addPT -typeName TestProductType1 -repository
> "file:///usr/local/oodt/data/archive" -typeDesc "This is a test product type"
> -versionClass "gov.nasa.jpl.oodt.myproductversioner" -url
> http://localhost:9000
> 3. View failure message: "ERROR: Failed to add product type with name
> 'TestProductType1', description 'This is a test product type', repository
> 'file:///usr/local/oodt/data/archive, and versioner
> 'gov.nasa.jpl.oodt.myproductversioner' : null"
> After some investigation, I found that the underlying problem here is that
> the AddProductTypeCliAction does not generate a ProductType object that has a
> ProductTypeId field set. I'm not sure why AddProductTypeCliAction does not
> prompt the user for this like it does for other arguments, because the
> XmlRepositoryManager requires a ProductTypeId to be present in order for
> policy to be generated (see [2] addProductType method). If ProductTypeId is
> not present within the ProductType object generated by this CliAction, then
> the XmlRepositoryManager will issue an error. In fact, I'll bet future
> repository managers will need ProductTypeId as much as XmlRepositoryManager
> does, so fixing this CliAction will be beneficial.
> --
> [1]
> http://svn.apache.org/repos/asf/oodt/trunk/filemgr/src/main/java/org/apache/oodt/cas/filemgr/cli/action/AddProductTypeCliAction.java
> [2]
> http://svn.apache.org/repos/asf/oodt/trunk/filemgr/src/main/java/org/apache/oodt/cas/filemgr/repository/XMLRepositoryManager.java
--
This message was sent by Atlassian JIRA
(v6.2#6252)