You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by "Ron Gavlin (JIRA)" <tu...@ws.apache.org> on 2006/09/07 22:26:22 UTC

[jira] Created: (TUSCANY-711) Tuscany SDO generates invalid namespace prefixes for namespaces that end with a '-' followed by a number

Tuscany SDO generates invalid namespace prefixes for namespaces that end with a '-' followed by a number
--------------------------------------------------------------------------------------------------------

                 Key: TUSCANY-711
                 URL: http://issues.apache.org/jira/browse/TUSCANY-711
             Project: Tuscany
          Issue Type: Bug
          Components: Java SDO Implementation
    Affects Versions: Java-M1
         Environment: Win2K Sun JDK 1.4.2_11
            Reporter: Ron Gavlin
            Priority: Critical


The Tuscany SDO Serializer generates an invalid namespace prefix for namespaces that end with a '-' followed by a number. 

For example, Tuscany SDO generates the invalid namespace prefix "1" for namespace http://www.example.com/simple-1. Any DataObjects saved with the .../simple-1 namespace cannot be subsequently loaded. 

I suspect this may be an EMF bug.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org


[jira] Updated: (TUSCANY-711) Tuscany SDO generates invalid namespace prefixes for namespaces that end with a '-' followed by a number

Posted by "Frank Budinsky (JIRA)" <tu...@ws.apache.org>.
     [ http://issues.apache.org/jira/browse/TUSCANY-711?page=all ]

Frank Budinsky updated TUSCANY-711:
-----------------------------------

    Fix Version/s: Java-Mx
                       (was: Java-M2)
         Priority: Minor  (was: Critical)

This issue is fixed in M2, but we're still looking for a JUnit so that we can make sure it doesn't get broken again in the future.

> Tuscany SDO generates invalid namespace prefixes for namespaces that end with a '-' followed by a number
> --------------------------------------------------------------------------------------------------------
>
>                 Key: TUSCANY-711
>                 URL: http://issues.apache.org/jira/browse/TUSCANY-711
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SDO Implementation
>    Affects Versions: Java-M1
>         Environment: Win2K Sun JDK 1.4.2_11
>            Reporter: Ron Gavlin
>            Priority: Minor
>             Fix For: Java-Mx
>
>
> The Tuscany SDO Serializer generates an invalid namespace prefix for namespaces that end with a '-' followed by a number. 
> For example, Tuscany SDO generates the invalid namespace prefix "1" for namespace http://www.example.com/simple-1. Any DataObjects saved with the .../simple-1 namespace cannot be subsequently loaded. 
> I suspect this may be an EMF bug.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org


[jira] Commented: (TUSCANY-711) Tuscany SDO generates invalid namespace prefixes for namespaces that end with a '-' followed by a number

Posted by "Ron Gavlin (JIRA)" <tu...@ws.apache.org>.
    [ http://issues.apache.org/jira/browse/TUSCANY-711?page=comments#action_12433955 ] 
            
Ron Gavlin commented on TUSCANY-711:
------------------------------------

After further investigation, I have confirmed this is definately a Tuscany SDO problem with class SDOXSDEcoreBuilder. The problem is caused by a limitation in Tuscany's efforts to override the standard EMF name-mangling algorithm.

Problematic-Line 226 of SDOXSDEcoreBuilder is as follows:

/**
 * Override default EMF behavior so that the name is not mangled.
 */
protected String validName(String name, int casing, String prefix) {
  return name;
}

For namespace "http://www.example.com/simple-1", this method is eventually called with parameters ("1", 2, "_"). The EMF NameMangler base class would return the correct value, "_1". The SDO-overridden method returns "1" which eventually gets used incorrectly as a namespace prefix. I can see a few fixes to this problem:

1. Modify SDOXSDEcoreBuilder.validName to handle this special case. I am not sure this is correct.

2. Add override method SDOXSDEcoreBuilder.getEPackage(XSDNamedComponent xsdNamedComponent). Reimplement the method replacing the invocation of qualifiedPackageName(targetNamespace) with SDOXSDEcoreBuilder.getDefaultPackageName(targetNamespace)

3. Add override method SDOXSDEcoreBuilder.qualifiedPackageName(String targetNamespace) which simply delegates to SDOXSDEcoreBuilder.getDefaultPackageName(targetNamespace). This looks like the most straightforward solution. Are there drawbacks?

This is a showstopper problem for us. Any guidance would be appreciated.

Thanks in advance,

- Ron



> Tuscany SDO generates invalid namespace prefixes for namespaces that end with a '-' followed by a number
> --------------------------------------------------------------------------------------------------------
>
>                 Key: TUSCANY-711
>                 URL: http://issues.apache.org/jira/browse/TUSCANY-711
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SDO Implementation
>    Affects Versions: Java-M1
>         Environment: Win2K Sun JDK 1.4.2_11
>            Reporter: Ron Gavlin
>            Priority: Critical
>
> The Tuscany SDO Serializer generates an invalid namespace prefix for namespaces that end with a '-' followed by a number. 
> For example, Tuscany SDO generates the invalid namespace prefix "1" for namespace http://www.example.com/simple-1. Any DataObjects saved with the .../simple-1 namespace cannot be subsequently loaded. 
> I suspect this may be an EMF bug.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org


[jira] Commented: (TUSCANY-711) Tuscany SDO generates invalid namespace prefixes for namespaces that end with a '-' followed by a number

Posted by "Yang ZHONG (JIRA)" <tu...@ws.apache.org>.
    [ http://issues.apache.org/jira/browse/TUSCANY-711?page=comments#action_12434007 ] 
            
Yang ZHONG commented on TUSCANY-711:
------------------------------------

Thanks a lot for such detailed info, I'm looking at this issure.

As for Ron fix 1, I agree with Ron it's not really correct since validName is also used for type, property and so on other than package.

As for Ron fix 2, there's also createAnnotation calling qualifiedPackageName, maybe that needs to be replaced with getDefaultPackageName too

As for Ron fix 3, if all qualifiedPackageName callers (getEPackage & createAnnotation so far, unknown in future) need to be applied SDO policies,
I agree with Ron it's the most straightforward solution so far.

Furthermore, the only caller of getDefaultPackageName, getEcoreAttribute so far, could also potentially call the SDO version of qualifiedPackageName.
So I'm thinking following steps to fix the issure:
    2-1. rename "static getDefaultPackageName" to "qualifiedPackageName"
    2-2. call "qualifiedPackageName" instead of "getDefaultPackageName"  in getEcoreAttribute

Comments?

> Tuscany SDO generates invalid namespace prefixes for namespaces that end with a '-' followed by a number
> --------------------------------------------------------------------------------------------------------
>
>                 Key: TUSCANY-711
>                 URL: http://issues.apache.org/jira/browse/TUSCANY-711
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SDO Implementation
>    Affects Versions: Java-M1
>         Environment: Win2K Sun JDK 1.4.2_11
>            Reporter: Ron Gavlin
>            Priority: Critical
>
> The Tuscany SDO Serializer generates an invalid namespace prefix for namespaces that end with a '-' followed by a number. 
> For example, Tuscany SDO generates the invalid namespace prefix "1" for namespace http://www.example.com/simple-1. Any DataObjects saved with the .../simple-1 namespace cannot be subsequently loaded. 
> I suspect this may be an EMF bug.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org


[jira] Commented: (TUSCANY-711) Tuscany SDO generates invalid namespace prefixes for namespaces that end with a '-' followed by a number

Posted by "Yang ZHONG (JIRA)" <tu...@ws.apache.org>.
    [ http://issues.apache.org/jira/browse/TUSCANY-711?page=comments#action_12434869 ] 
            
Yang ZHONG commented on TUSCANY-711:
------------------------------------

Ron, is it possible to simplify your case and add into
    tuscany\java\sdo\impl\src\test\java\org\apache\tuscany\sdo\test
please? The Test Case needs to be named ending with "TestCase" such as "PackageManglingTestCase.java"
and the XSD(s) (if any) can go into
    tuscany\java\sdo\impl\src\test\resources.

Otherwise could you please attach your case in the JIRA so that I can simplify and add a Test Case?

Thanks.

> Tuscany SDO generates invalid namespace prefixes for namespaces that end with a '-' followed by a number
> --------------------------------------------------------------------------------------------------------
>
>                 Key: TUSCANY-711
>                 URL: http://issues.apache.org/jira/browse/TUSCANY-711
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SDO Implementation
>    Affects Versions: Java-M1
>         Environment: Win2K Sun JDK 1.4.2_11
>            Reporter: Ron Gavlin
>            Priority: Critical
>
> The Tuscany SDO Serializer generates an invalid namespace prefix for namespaces that end with a '-' followed by a number. 
> For example, Tuscany SDO generates the invalid namespace prefix "1" for namespace http://www.example.com/simple-1. Any DataObjects saved with the .../simple-1 namespace cannot be subsequently loaded. 
> I suspect this may be an EMF bug.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org


[jira] Commented: (TUSCANY-711) Tuscany SDO generates invalid namespace prefixes for namespaces that end with a '-' followed by a number

Posted by "Frank Budinsky (JIRA)" <tu...@ws.apache.org>.
    [ http://issues.apache.org/jira/browse/TUSCANY-711?page=comments#action_12434198 ] 
            
Frank Budinsky commented on TUSCANY-711:
----------------------------------------

Thank you Ron and Yang for doing the background work.

I think the correct answer is #3. 

Yang, we can't rename the static getDefaultPackageName() method (as you suggested in 2-1) because it's called by other components (SCA tools).

I also noticed that once we override qualifiedPackageName(), I think there's no need for the getEcoreAttribute() override in SDOXSDEcoreBuilder, because all it will be doing now is setting the package name to the same thing as qualifiedPackageName returned. So, I commeted out that method as well.

I committed the fix in revision 442625.

I think it would be good to add a JUnit for this.

Thanks,
Frank.


> Tuscany SDO generates invalid namespace prefixes for namespaces that end with a '-' followed by a number
> --------------------------------------------------------------------------------------------------------
>
>                 Key: TUSCANY-711
>                 URL: http://issues.apache.org/jira/browse/TUSCANY-711
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SDO Implementation
>    Affects Versions: Java-M1
>         Environment: Win2K Sun JDK 1.4.2_11
>            Reporter: Ron Gavlin
>            Priority: Critical
>
> The Tuscany SDO Serializer generates an invalid namespace prefix for namespaces that end with a '-' followed by a number. 
> For example, Tuscany SDO generates the invalid namespace prefix "1" for namespace http://www.example.com/simple-1. Any DataObjects saved with the .../simple-1 namespace cannot be subsequently loaded. 
> I suspect this may be an EMF bug.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org


[jira] Updated: (TUSCANY-711) Tuscany SDO generates invalid namespace prefixes for namespaces that end with a '-' followed by a number

Posted by "ant elder (JIRA)" <tu...@ws.apache.org>.
     [ http://issues.apache.org/jira/browse/TUSCANY-711?page=all ]

ant elder updated TUSCANY-711:
------------------------------

    Fix Version/s: Java-M2

> Tuscany SDO generates invalid namespace prefixes for namespaces that end with a '-' followed by a number
> --------------------------------------------------------------------------------------------------------
>
>                 Key: TUSCANY-711
>                 URL: http://issues.apache.org/jira/browse/TUSCANY-711
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SDO Implementation
>    Affects Versions: Java-M1
>         Environment: Win2K Sun JDK 1.4.2_11
>            Reporter: Ron Gavlin
>            Priority: Critical
>             Fix For: Java-M2
>
>
> The Tuscany SDO Serializer generates an invalid namespace prefix for namespaces that end with a '-' followed by a number. 
> For example, Tuscany SDO generates the invalid namespace prefix "1" for namespace http://www.example.com/simple-1. Any DataObjects saved with the .../simple-1 namespace cannot be subsequently loaded. 
> I suspect this may be an EMF bug.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org


[jira] Resolved: (TUSCANY-711) Tuscany SDO generates invalid namespace prefixes for namespaces that end with a '-' followed by a number

Posted by "Kelvin Goodson (JIRA)" <tu...@ws.apache.org>.
     [ http://issues.apache.org/jira/browse/TUSCANY-711?page=all ]

Kelvin Goodson resolved TUSCANY-711.
------------------------------------

    Resolution: Fixed

added testcase for prefix generation

> Tuscany SDO generates invalid namespace prefixes for namespaces that end with a '-' followed by a number
> --------------------------------------------------------------------------------------------------------
>
>                 Key: TUSCANY-711
>                 URL: http://issues.apache.org/jira/browse/TUSCANY-711
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SDO Implementation
>    Affects Versions: Java-M1
>         Environment: Win2K Sun JDK 1.4.2_11
>            Reporter: Ron Gavlin
>            Priority: Minor
>             Fix For: Java-Mx
>
>
> The Tuscany SDO Serializer generates an invalid namespace prefix for namespaces that end with a '-' followed by a number. 
> For example, Tuscany SDO generates the invalid namespace prefix "1" for namespace http://www.example.com/simple-1. Any DataObjects saved with the .../simple-1 namespace cannot be subsequently loaded. 
> I suspect this may be an EMF bug.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org


[jira] Commented: (TUSCANY-711) Tuscany SDO generates invalid namespace prefixes for namespaces that end with a '-' followed by a number

Posted by "Ron Gavlin (JIRA)" <tu...@ws.apache.org>.
    [ http://issues.apache.org/jira/browse/TUSCANY-711?page=comments#action_12433834 ] 
            
Ron Gavlin commented on TUSCANY-711:
------------------------------------

Since I am pretty confident that this is an EMF bug, I went ahead a submitted EMF bug# 156861.

> Tuscany SDO generates invalid namespace prefixes for namespaces that end with a '-' followed by a number
> --------------------------------------------------------------------------------------------------------
>
>                 Key: TUSCANY-711
>                 URL: http://issues.apache.org/jira/browse/TUSCANY-711
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SDO Implementation
>    Affects Versions: Java-M1
>         Environment: Win2K Sun JDK 1.4.2_11
>            Reporter: Ron Gavlin
>            Priority: Critical
>
> The Tuscany SDO Serializer generates an invalid namespace prefix for namespaces that end with a '-' followed by a number. 
> For example, Tuscany SDO generates the invalid namespace prefix "1" for namespace http://www.example.com/simple-1. Any DataObjects saved with the .../simple-1 namespace cannot be subsequently loaded. 
> I suspect this may be an EMF bug.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org