xmlbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ra...@apache.org
Subject svn commit: r158857 - in xmlbeans/trunk/src: common/org/apache/xmlbeans/impl/common/NameUtil.java typeimpl/org/apache/xmlbeans/impl/schema/StscState.java xmlpublic/org/apache/xmlbeans/message.properties
Date Thu, 24 Mar 2005 01:48:45 GMT
Author: radup
Date: Wed Mar 23 17:48:43 2005
New Revision: 158857

URL: http://svn.apache.org/viewcvs?view=rev&rev=158857
Log:
More meaningful error messages for duplicate names.
Added "enum" as a keyword so it will be avoided when generating Java names.

Modified:
    xmlbeans/trunk/src/common/org/apache/xmlbeans/impl/common/NameUtil.java
    xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/StscState.java
    xmlbeans/trunk/src/xmlpublic/org/apache/xmlbeans/message.properties

Modified: xmlbeans/trunk/src/common/org/apache/xmlbeans/impl/common/NameUtil.java
URL: http://svn.apache.org/viewcvs/xmlbeans/trunk/src/common/org/apache/xmlbeans/impl/common/NameUtil.java?view=diff&r1=158856&r2=158857
==============================================================================
--- xmlbeans/trunk/src/common/org/apache/xmlbeans/impl/common/NameUtil.java (original)
+++ xmlbeans/trunk/src/common/org/apache/xmlbeans/impl/common/NameUtil.java Wed Mar 23 17:48:43
2005
@@ -51,6 +51,7 @@
               "do",
               "double",
               "else",
+              "enum", // since JDK1.5
               "extends",
               "false", // not a keyword
               "final",

Modified: xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/StscState.java
URL: http://svn.apache.org/viewcvs/xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/StscState.java?view=diff&r1=158856&r2=158857
==============================================================================
--- xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/StscState.java (original)
+++ xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/StscState.java Wed Mar 23
17:48:43 2005
@@ -748,7 +748,9 @@
                 if (_redefinedGlobalTypes.containsKey(redefined))
                 {
                     if (!ignoreMdef(name))
-                        error(XmlErrorCodes.SCHEMA_PROPERTIES$DUPLICATE, new Object[] { "global
type", QNameHelper.pretty(name) } , null);
+                        error(XmlErrorCodes.SCHEMA_PROPERTIES$DUPLICATE,
+                            new Object[] { "global type", QNameHelper.pretty(name), ((SchemaType)
_redefinedGlobalTypes.get(redefined)).getSourceName() } ,
+                            type.getParseObject());
                 }
                 else
                 {
@@ -761,7 +763,9 @@
                 if (_globalTypes.containsKey(name))
                 {
                     if (!ignoreMdef(name))
-                        error(XmlErrorCodes.SCHEMA_PROPERTIES$DUPLICATE, new Object[] { "global
type", QNameHelper.pretty(name) } , null);
+                        error(XmlErrorCodes.SCHEMA_PROPERTIES$DUPLICATE,
+                            new Object[] { "global type", QNameHelper.pretty(name), ((SchemaType)
_globalTypes.get(name)).getSourceName() },
+                            type.getParseObject());
                 }
                 else
                 {
@@ -806,7 +810,9 @@
         if (_documentTypes.containsKey(name))
         {
             if (!ignoreMdef(name))
-                error(XmlErrorCodes.SCHEMA_PROPERTIES$DUPLICATE, new Object[] { "global element",
QNameHelper.pretty(name) }, null);
+                error(XmlErrorCodes.SCHEMA_PROPERTIES$DUPLICATE,
+                    new Object[] { "global element", QNameHelper.pretty(name), ((SchemaComponent)
_documentTypes.get(name)).getSourceName() },
+                    type.getParseObject());
         }
         else
         {
@@ -842,7 +848,9 @@
         if (_attributeTypes.containsKey(name))
         {
             if (!ignoreMdef(name))
-                error(XmlErrorCodes.SCHEMA_PROPERTIES$DUPLICATE, new Object[] { "global attribute",
QNameHelper.pretty(name) }, null);
+                error(XmlErrorCodes.SCHEMA_PROPERTIES$DUPLICATE,
+                    new Object[] { "global attribute", QNameHelper.pretty(name), ((SchemaComponent)
_attributeTypes.get(name)).getSourceName() },
+                    type.getParseObject());
         }
         else
         {
@@ -966,7 +974,9 @@
                 if (_redefinedAttributeGroups.containsKey(redefined))
                 {
                     if (!ignoreMdef(name))
-                        error(XmlErrorCodes.SCHEMA_PROPERTIES$DUPLICATE, new Object[] { "attribute
group", QNameHelper.pretty(name) } , null);
+                        error(XmlErrorCodes.SCHEMA_PROPERTIES$DUPLICATE,
+                            new Object[] { "attribute group", QNameHelper.pretty(name), ((SchemaComponent)
_redefinedAttributeGroups.get(redefined)).getSourceName() },
+                            attributeGroup.getParseObject());
                 }
                 else
                 {
@@ -979,7 +989,9 @@
                 if (_attributeGroups.containsKey( name ))
                 {
                     if (!ignoreMdef(name))
-                        error(XmlErrorCodes.SCHEMA_PROPERTIES$DUPLICATE, new Object[] { "attribute
group", QNameHelper.pretty(name) } , null);
+                        error(XmlErrorCodes.SCHEMA_PROPERTIES$DUPLICATE,
+                            new Object[] { "attribute group", QNameHelper.pretty(name), ((SchemaComponent)
_attributeGroups.get(name)).getSourceName() },
+                            attributeGroup.getParseObject());
                 }
                 else
                 {
@@ -1041,7 +1053,9 @@
                 if (_redefinedModelGroups.containsKey(redefined))
                 {
                     if (!ignoreMdef(name))
-                        error(XmlErrorCodes.SCHEMA_PROPERTIES$DUPLICATE, new Object[] { "model
group", QNameHelper.pretty(name) } , null);
+                        error(XmlErrorCodes.SCHEMA_PROPERTIES$DUPLICATE,
+                            new Object[] { "model group", QNameHelper.pretty(name), ((SchemaComponent)
_redefinedModelGroups.get(redefined)).getSourceName() },
+                            modelGroup.getParseObject());
                 }
                 else
                 {
@@ -1054,7 +1068,9 @@
                 if (_modelGroups.containsKey(name))
                 {
                     if (!ignoreMdef(name))
-                        error(XmlErrorCodes.SCHEMA_PROPERTIES$DUPLICATE, new Object[] { "model
group", QNameHelper.pretty(name) } , null);
+                        error(XmlErrorCodes.SCHEMA_PROPERTIES$DUPLICATE,
+                            new Object[] { "model group", QNameHelper.pretty(name), ((SchemaComponent)
_modelGroups.get(name)).getSourceName() },
+                            modelGroup.getParseObject());
                 }
                 else
                 {
@@ -1092,7 +1108,9 @@
             if (_idConstraints.containsKey(name))
             {
                 if (!ignoreMdef(name))
-                    warning(XmlErrorCodes.SCHEMA_PROPERTIES$DUPLICATE, new Object[] { "identity
constraint", QNameHelper.pretty(name) } , null);
+                    warning(XmlErrorCodes.SCHEMA_PROPERTIES$DUPLICATE,
+                        new Object[] { "identity constraint", QNameHelper.pretty(name), ((SchemaComponent)
_idConstraints.get(name)).getSourceName() },
+                        idc.getParseObject());
             }
             else
             {

Modified: xmlbeans/trunk/src/xmlpublic/org/apache/xmlbeans/message.properties
URL: http://svn.apache.org/viewcvs/xmlbeans/trunk/src/xmlpublic/org/apache/xmlbeans/message.properties?view=diff&r1=158856&r2=158857
==============================================================================
--- xmlbeans/trunk/src/xmlpublic/org/apache/xmlbeans/message.properties (original)
+++ xmlbeans/trunk/src/xmlpublic/org/apache/xmlbeans/message.properties Wed Mar 23 17:48:43
2005
@@ -812,7 +812,7 @@
 Schema Properties Correct
 
 sch-props-correct.2 = \
-Duplicate {0}: {1}
+Duplicate {0}: {1} (Original {0} found in file: {2})
 
 st-props-correct = \
 Simple Type Definition Properties Correct



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: commits-help@xmlbeans.apache.org


Mime
View raw message