From: Dave B. <bla...@us...> - 2013-07-02 01:55:28
|
Update of /cvsroot/sblim/jsr48-client/src/org/sblim/cimclient/internal/cimxml/sax/node In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv2011/src/org/sblim/cimclient/internal/cimxml/sax/node Modified Files: Tag: Experimental ValueObjectNode.java KeyValueNode.java NameSpaceNode.java QualifierNode.java ErrorNode.java ValueRefArrayNode.java CIMNode.java ValueReferenceNode.java QualiDeclNode.java Log Message: 2604 SAXException messages should contain node name Index: ValueReferenceNode.java =================================================================== RCS file: /cvsroot/sblim/jsr48-client/src/org/sblim/cimclient/internal/cimxml/sax/node/ValueReferenceNode.java,v retrieving revision 1.1.2.10 retrieving revision 1.1.2.11 diff -u -d -r1.1.2.10 -r1.1.2.11 --- ValueReferenceNode.java 24 Apr 2012 12:52:05 -0000 1.1.2.10 +++ ValueReferenceNode.java 2 Jul 2013 01:55:25 -0000 1.1.2.11 @@ -1,5 +1,5 @@ /** - * (C) Copyright IBM Corp. 2006, 2012 + * (C) Copyright IBM Corp. 2006, 2013 * * THIS FILE IS PROVIDED UNDER THE TERMS OF THE ECLIPSE PUBLIC LICENSE * ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE @@ -21,6 +21,7 @@ * 2531371 2009-02-10 raman_arora Upgrade client to JDK 1.5 (Phase 2) * 3511454 2012-03-27 blaschke-oss SAX nodes not reinitialized properly * 3466280 2012-04-23 blaschke-oss get instance failure for CIM_IndicationSubscription + * 2604 2013-07-01 blaschke-oss SAXException messages should contain node name */ package org.sblim.cimclient.internal.cimxml.sax.node; @@ -94,7 +95,7 @@ this.iChildNodeName = pNodeNameEnum; return; } - throw new SAXException("Invalid child node:" + pNodeNameEnum + throw new SAXException("Invalid child node in " + getNodeName() + " node: " + pNodeNameEnum + "! Valid nodes are CLASSPATH, LOCALCLASSPATH, CLASSNAME, " + "INSTANCEPATH, LOCALINSTANCEPATH, INSTANCENAME"); } Index: ValueObjectNode.java =================================================================== RCS file: /cvsroot/sblim/jsr48-client/src/org/sblim/cimclient/internal/cimxml/sax/node/ValueObjectNode.java,v retrieving revision 1.1.2.10 retrieving revision 1.1.2.11 diff -u -d -r1.1.2.10 -r1.1.2.11 --- ValueObjectNode.java 30 Jan 2013 14:57:10 -0000 1.1.2.10 +++ ValueObjectNode.java 2 Jul 2013 01:55:25 -0000 1.1.2.11 @@ -21,6 +21,7 @@ * 2524131 2009-01-21 raman_arora Upgrade client to JDK 1.5 (Phase 1) * 2531371 2009-02-10 raman_arora Upgrade client to JDK 1.5 (Phase 2) * 3602604 2013-01-29 blaschke-oss Clean up SAXException messages + * 2604 2013-07-01 blaschke-oss SAXException messages should contain node name */ package org.sblim.cimclient.internal.cimxml.sax.node; @@ -67,11 +68,12 @@ @Override public void testChild(String pNodeNameEnum) throws SAXException { - if (this.iCIMObject != null) throw new SAXException( - "This node can have only one child but an additional " + pNodeNameEnum - + " node found!"); + if (this.iCIMObject != null) throw new SAXException("This " + getNodeName() + + " node can have only one child but an additional " + pNodeNameEnum + + " node found!"); if (pNodeNameEnum != CLASS && pNodeNameEnum != INSTANCE) throw new SAXException( - "Child node can be CLASS or INSTANCE but a " + pNodeNameEnum + " node was found!"); + getNodeName() + " node child node can be CLASS or INSTANCE but a " + pNodeNameEnum + + " node was found!"); } @Override Index: ErrorNode.java =================================================================== RCS file: /cvsroot/sblim/jsr48-client/src/org/sblim/cimclient/internal/cimxml/sax/node/ErrorNode.java,v retrieving revision 1.1.2.10 retrieving revision 1.1.2.11 diff -u -d -r1.1.2.10 -r1.1.2.11 --- ErrorNode.java 3 May 2011 15:05:03 -0000 1.1.2.10 +++ ErrorNode.java 2 Jul 2013 01:55:25 -0000 1.1.2.11 @@ -1,5 +1,5 @@ /** - * (C) Copyright IBM Corp. 2006, 2011 + * (C) Copyright IBM Corp. 2006, 2013 * * THIS FILE IS PROVIDED UNDER THE TERMS OF THE ECLIPSE PUBLIC LICENSE * ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE @@ -21,6 +21,7 @@ * 2531371 2009-02-10 raman_arora Upgrade client to JDK 1.5 (Phase 2) * 2763216 2009-04-14 blaschke-oss Code cleanup: visible spelling/grammar errors * 3293248 2011-05-03 blaschke-oss Support for CIM_ERROR instances within ERROR + * 2604 2013-07-01 blaschke-oss SAXException messages should contain node name */ package org.sblim.cimclient.internal.cimxml.sax.node; @@ -69,7 +70,8 @@ try { this.iCode = Integer.parseInt(code); } catch (NumberFormatException e) { - throw new SAXException("Failed to parse CODE attribute!", e); + throw new SAXException("Failed to parse CODE attribute in " + getNodeName() + " node!", + e); } this.iDesc = pAttribs.getValue("DESCRIPTION"); } Index: QualifierNode.java =================================================================== RCS file: /cvsroot/sblim/jsr48-client/src/org/sblim/cimclient/internal/cimxml/sax/node/QualifierNode.java,v retrieving revision 1.1.2.15 retrieving revision 1.1.2.16 diff -u -d -r1.1.2.15 -r1.1.2.16 --- QualifierNode.java 31 Mar 2012 00:02:16 -0000 1.1.2.15 +++ QualifierNode.java 2 Jul 2013 01:55:25 -0000 1.1.2.16 @@ -1,5 +1,5 @@ /** - * (C) Copyright IBM Corp. 2006, 2012 + * (C) Copyright IBM Corp. 2006, 2013 * * THIS FILE IS PROVIDED UNDER THE TERMS OF THE ECLIPSE PUBLIC LICENSE * ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE @@ -25,6 +25,7 @@ * 2531371 2009-02-10 raman_arora Upgrade client to JDK 1.5 (Phase 2) * 2797550 2009-06-01 raman_arora JSR48 compliance - add Java Generics * 3513353 2012-03-30 blaschke-oss TCK: CIMDataType arrays must have length >= 1 + * 2604 2013-07-01 blaschke-oss SAXException messages should contain node name */ package org.sblim.cimclient.internal.cimxml.sax.node; @@ -159,7 +160,8 @@ private void setType(TypedIf pTypedIf) throws SAXException { if (this.iType != null) return; this.iType = pTypedIf.getType(); - if (this.iType == null) throw new SAXException("Unknown type for Qualifier declaration!"); + if (this.iType == null) throw new SAXException("Unknown type for Qualifier declaration in " + + getNodeName() + " node!"); } } Index: CIMNode.java =================================================================== RCS file: /cvsroot/sblim/jsr48-client/src/org/sblim/cimclient/internal/cimxml/sax/node/CIMNode.java,v retrieving revision 1.1.2.8 retrieving revision 1.1.2.9 diff -u -d -r1.1.2.8 -r1.1.2.9 --- CIMNode.java 27 Mar 2012 19:06:32 -0000 1.1.2.8 +++ CIMNode.java 2 Jul 2013 01:55:25 -0000 1.1.2.9 @@ -1,5 +1,5 @@ /** - * (C) Copyright IBM Corp. 2006, 2012 + * (C) Copyright IBM Corp. 2006, 2013 * * THIS FILE IS PROVIDED UNDER THE TERMS OF THE ECLIPSE PUBLIC LICENSE * ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE @@ -19,6 +19,7 @@ * 2003590 2008-06-30 blaschke-oss Change licensing from CPL to EPL * 2524131 2009-01-21 raman_arora Upgrade client to JDK 1.5 (Phase 1) * 3511454 2012-03-27 blaschke-oss SAX nodes not reinitialized properly + * 2604 2013-07-01 blaschke-oss SAXException messages should contain node name */ package org.sblim.cimclient.internal.cimxml.sax.node; @@ -58,9 +59,11 @@ @Override public void init(Attributes pAttribs, SAXSession pSession) throws SAXException { this.iCimVersion = pAttribs.getValue("CIMVERSION"); - if (this.iCimVersion == null) { throw new SAXException("CIMVERSION attribute is mandatory!"); } + if (this.iCimVersion == null) { throw new SAXException( + "CIMVERSION attribute is mandatory for " + getNodeName() + " node!"); } this.iDtdVersion = pAttribs.getValue("DTDVERSION"); - if (this.iDtdVersion == null) { throw new SAXException("DTDVERSION attribute is mandatory!"); } + if (this.iDtdVersion == null) { throw new SAXException( + "DTDVERSION attribute is mandatory for " + getNodeName() + " node!"); } this.iContent = null; } Index: ValueRefArrayNode.java =================================================================== RCS file: /cvsroot/sblim/jsr48-client/src/org/sblim/cimclient/internal/cimxml/sax/node/ValueRefArrayNode.java,v retrieving revision 1.1.2.12 retrieving revision 1.1.2.13 diff -u -d -r1.1.2.12 -r1.1.2.13 --- ValueRefArrayNode.java 30 Jan 2013 14:57:10 -0000 1.1.2.12 +++ ValueRefArrayNode.java 2 Jul 2013 01:55:25 -0000 1.1.2.13 @@ -23,6 +23,7 @@ * 3511454 2012-03-27 blaschke-oss SAX nodes not reinitialized properly * 3513349 2012-03-31 blaschke-oss TCK: CIMDataType must not accept null string * 3602604 2013-01-29 blaschke-oss Clean up SAXException messages + * 2604 2013-07-01 blaschke-oss SAXException messages should contain node name */ package org.sblim.cimclient.internal.cimxml.sax.node; @@ -71,8 +72,8 @@ @Override public void testChild(String pNodeNameEnum) throws SAXException { - if (pNodeNameEnum != VALUE_REFERENCE) throw new SAXException( - "Child node can be VALUE_REFERENCE only while it is " + pNodeNameEnum + "!"); + if (pNodeNameEnum != VALUE_REFERENCE) throw new SAXException(getNodeName() + + " node child node can be VALUE_REFERENCE only while it is " + pNodeNameEnum + "!"); } @Override Index: QualiDeclNode.java =================================================================== RCS file: /cvsroot/sblim/jsr48-client/src/org/sblim/cimclient/internal/cimxml/sax/node/QualiDeclNode.java,v retrieving revision 1.1.2.13 retrieving revision 1.1.2.14 diff -u -d -r1.1.2.13 -r1.1.2.14 --- QualiDeclNode.java 25 Apr 2012 02:34:37 -0000 1.1.2.13 +++ QualiDeclNode.java 2 Jul 2013 01:55:25 -0000 1.1.2.14 @@ -1,5 +1,5 @@ /** - * (C) Copyright IBM Corp. 2006, 2012 + * (C) Copyright IBM Corp. 2006, 2013 * * THIS FILE IS PROVIDED UNDER THE TERMS OF THE ECLIPSE PUBLIC LICENSE * ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE @@ -24,6 +24,7 @@ * 3511454 2012-03-27 blaschke-oss SAX nodes not reinitialized properly * 3513353 2012-03-30 blaschke-oss TCK: CIMDataType arrays must have length >= 1 * 3521119 2012-04-24 blaschke-oss JSR48 1.0.0: remove CIMObjectPath 2/3/4-parm ctors + * 2604 2013-07-01 blaschke-oss SAXException messages should contain node name */ package org.sblim.cimclient.internal.cimxml.sax.node; @@ -124,10 +125,11 @@ public void testChild(String pNodeNameEnum) throws SAXException { if (pNodeNameEnum == VALUE || pNodeNameEnum == VALUE_ARRAY) { if (this.iValueNodeName != null) throw new SAXException("Cannot add " + pNodeNameEnum - + " node! This node already has got a " + this.iValueNodeName + " node."); + + " node, this " + getNodeName() + " node has already got a " + + this.iValueNodeName + " node!"); } else if (pNodeNameEnum == SCOPE) { if (this.iHasScope) throw new SAXException("Cannot add " + pNodeNameEnum - + " node, still this node has already got one!"); + + " node, this " + getNodeName() + " node has already got one!"); } else throw new SAXException(getNodeName() + " node cannot have " + pNodeNameEnum + " child node!"); } @@ -143,7 +145,8 @@ private void setType(TypedIf pTypedIf) throws SAXException { if (this.iType != null) return; this.iType = pTypedIf.getType(); - if (this.iType == null) throw new SAXException("Unknown type for Qualifier declaration!"); + if (this.iType == null) throw new SAXException("Unknown type for Qualifier declaration in " + + getNodeName() + " node!"); } @Override @@ -173,7 +176,8 @@ @Override public void testCompletness() throws SAXException { - if (this.iType == null) throw new SAXException("Unknown type for Qualifier declaration!"); + if (this.iType == null) throw new SAXException("Unknown type for Qualifier declaration in " + + getNodeName() + " node!"); } /** Index: NameSpaceNode.java =================================================================== RCS file: /cvsroot/sblim/jsr48-client/src/org/sblim/cimclient/internal/cimxml/sax/node/NameSpaceNode.java,v retrieving revision 1.1.2.7 retrieving revision 1.1.2.8 diff -u -d -r1.1.2.7 -r1.1.2.8 --- NameSpaceNode.java 23 Feb 2009 18:25:57 -0000 1.1.2.7 +++ NameSpaceNode.java 2 Jul 2013 01:55:25 -0000 1.1.2.8 @@ -1,5 +1,5 @@ /** - * (C) Copyright IBM Corp. 2006, 2009 + * (C) Copyright IBM Corp. 2006, 2013 * * THIS FILE IS PROVIDED UNDER THE TERMS OF THE ECLIPSE PUBLIC LICENSE * ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE @@ -18,6 +18,7 @@ * 1720707 2007-05-17 ebak Conventional Node factory for CIM-XML SAX parser * 2003590 2008-06-30 blaschke-oss Change licensing from CPL to EPL * 2524131 2009-01-21 raman_arora Upgrade client to JDK 1.5 (Phase 1) + * 2604 2013-07-01 blaschke-oss SAXException messages should contain node name */ package org.sblim.cimclient.internal.cimxml.sax.node; @@ -76,7 +77,7 @@ @Override public void testCompletness() throws SAXException { if (this.iNameSpaceValue == null) throw new SAXException( - "NAME attribute must contain a value!"); + "NAME attribute must contain a value in " + getNodeName() + " node!"); } /** Index: KeyValueNode.java =================================================================== RCS file: /cvsroot/sblim/jsr48-client/src/org/sblim/cimclient/internal/cimxml/sax/node/KeyValueNode.java,v retrieving revision 1.1.2.15 retrieving revision 1.1.2.16 diff -u -d -r1.1.2.15 -r1.1.2.16 --- KeyValueNode.java 30 Jan 2013 14:57:10 -0000 1.1.2.15 +++ KeyValueNode.java 2 Jul 2013 01:55:25 -0000 1.1.2.16 @@ -24,6 +24,7 @@ * 2823494 2009-08-03 rgummada Change Boolean constructor to static * 3572993 2012-10-01 blaschke-oss parseDouble("2.2250738585072012e-308") DoS vulnerability * 3602604 2013-01-29 blaschke-oss Clean up SAXException messages + * 2604 2013-07-01 blaschke-oss SAXException messages should contain node name */ package org.sblim.cimclient.internal.cimxml.sax.node; @@ -125,15 +126,15 @@ if (this.iValueTypeStr.equals("numeric")) { if (!setUInt64(pValue) && !setSInt64(pValue) && !setReal64(pValue)) throw new SAXException( - "Unparseable \"number\" value: " + pValue + "!"); + "Unparseable \"number\" value in " + getNodeName() + " node: " + pValue + "!"); } else if (this.iValueTypeStr.equals(MOF.DT_STR)) { if (!setDTAbsolute(pValue) && !setDTInterval(pValue)) { this.iValue = pValue; this.iType = CIMDataType.STRING_T; } } else if (this.iValueTypeStr.equals(MOF.DT_BOOL)) { - if (!setBoolean(pValue)) throw new SAXException("Unparseable \"boolean\" value: " - + pValue + "!"); + if (!setBoolean(pValue)) throw new SAXException("Unparseable \"boolean\" value in " + + getNodeName() + " node: " + pValue + "!"); } else { throw new SAXException("KEYVALUE node's VALUETYPE attribute must be " + MOF.DT_STR + ", " + MOF.DT_BOOL + " or numeric! " + pValue + " is not allowed!"); |