Skip to content

Commit

Permalink
FIX BUG: A bunch of MOs are missing
Browse files Browse the repository at this point in the history
When the MO names in the parameter file are not exactly the
same as those in the dump file, the MO csv files are not
generated
  • Loading branch information
erssebaggala committed Jul 30, 2018
1 parent f790975 commit 7fc96d2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<groupId>com.bodastage.boda_huaweicmobjectparser</groupId>
<artifactId>boda-huaweicmobjectparser</artifactId>
<packaging>jar</packaging>
<version>1.0.6-SNAPSHOT</version>
<version>1.0.7-SNAPSHOT</version>
<name>boda-huaweicmobjectparser</name>
<url>http://maven.apache.org</url>
<dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
*/
public class HuaweiCMObjectParser {

final static String VERSION = "1.0.6";
final static String VERSION = "1.0.7";

Logger logger = LoggerFactory.getLogger(HuaweiCMObjectParser.class);

Expand Down Expand Up @@ -789,14 +789,14 @@ public void endELementEvent(XMLEvent xmlEvent)
objectDepth--;

//Skip mo if it is not in the parameter file
String classNameMinusNodeType = className.replaceAll("_.*$" ,"");
//String className = className.replaceAll("_.*$" ,"");

if (!moColumns.containsKey(classNameMinusNodeType)) return;
if (!moColumns.containsKey(className)) return;

//logger.info("classNameMinusNodeType : " + classNameMinusNodeType);
//logger.info("className : " + className);

//Get the parameter listed in the parameter file for the managed object
Stack<String> parameterList = moColumns.get(classNameMinusNodeType);
Stack<String> parameterList = moColumns.get(className);

String paramNames = "";
String paramValues = "";
Expand All @@ -807,7 +807,7 @@ public void endELementEvent(XMLEvent xmlEvent)
String moiFile = outputDirectory + File.separatorChar + className + ".csv";
moiPrintWriters.put(className, new PrintWriter(moiFile));

Stack moiAttributes = moColumns.get(classNameMinusNodeType);
Stack moiAttributes = moColumns.get(className);

String pName = paramNames;
for(int i = 0; i< moiAttributes.size(); i++){
Expand All @@ -820,15 +820,15 @@ public void endELementEvent(XMLEvent xmlEvent)
moiPrintWriters.get(className).flush();
}

Stack moiAttributes = moColumns.get(classNameMinusNodeType);
Stack moiAttributes = moColumns.get(className);
moiParameterValueMap = classNameAttrsMap;
// moiParameterValueMap = classNameAttrsMap.get(className);

for (int i = 0; i < moiAttributes.size(); i++) {
String moiName = moiAttributes.get(i).toString();

//String mvParameter = className + "_" + moiName;
String mvParameter = classNameMinusNodeType + "_" + moiName;
String mvParameter = className + "_" + moiName;

if (moiParameterValueMap.containsKey(moiName)) {
//Handle multivalued parameters
Expand Down

0 comments on commit 7fc96d2

Please sign in to comment.