[ 
https://issues.apache.org/jira/browse/JENA-878?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14327258#comment-14327258
 ] 

ASF GitHub Bot commented on JENA-878:
-------------------------------------

Github user afs commented on a diff in the pull request:

    https://github.com/apache/jena/pull/31#discussion_r24980025
  
    --- Diff: 
jena-core/src/main/java/com/hp/hpl/jena/datatypes/xsd/XSDDatatype.java ---
    @@ -251,7 +269,7 @@ public XSDDatatype(String typeName, Class<?> javaClass) 
{
          * @param xstype the XSSimpleType definition to be wrapped
          * @param namespace the namespace for the type (used because the 
grammar loading doesn't seem to keep that)
          */
    -    public XSDDatatype(XSSimpleType xstype, String namespace) {
    +    XSDDatatype(XSSimpleType xstype, String namespace) {
    --- End diff --
    
    Jena provides all the meaningful XSD types (just some XML specific types 
are missing) so it is unlikely that external code is calling this public 
constructor.  Howver, it is public.  If the aim is to hide Xerces XSSimpleType, 
then hop 
    about:
    
    1. Make this protected.
    2. Add `public XSDDatatype(Object xstype, String namespace)` and cast to 
`XSSimpleType`
    
    I thhnk that will keep OSGi happy(ier).


> Avoid dependencies on xerces.impl
> ---------------------------------
>
>                 Key: JENA-878
>                 URL: https://issues.apache.org/jira/browse/JENA-878
>             Project: Apache Jena
>          Issue Type: Task
>          Components: Jena
>    Affects Versions: Jena 2.13.0
>            Reporter: Stian Soiland-Reyes
>            Priority: Minor
>
> Building jena-osgi complains about xerces.impl dependencies:
> > [WARNING] Bundle org.apache.jena:jena-osgi:bundle:2.12.2-SNAPSHOT : Unused
> > Private-Package instructions, no such package(s) on the class path: [!*]
> > [WARNING] Bundle org.apache.jena:jena-osgi:bundle:2.12.2-SNAPSHOT : Export
> > com.hp.hpl.jena.datatypes.xsd,  has 1,  private references
> > [org.apache.xerces.impl.dv],
> {code}
> stain@biggie-utopic:~/src/jena/jena-core/src/main/java/com/hp/hpl/jena/datatypes$
>  grep -r xerces.*impl .
> ./xsd/XSDDatatype.java:import org.apache.xerces.impl.dv.* ;
> ./xsd/XSDDatatype.java:import org.apache.xerces.impl.dv.util.Base64 ;
> ./xsd/XSDDatatype.java:import org.apache.xerces.impl.dv.util.HexBin ;
> ./xsd/XSDDatatype.java:import org.apache.xerces.impl.dv.xs.DecimalDV ;
> ./xsd/XSDDatatype.java:import org.apache.xerces.impl.dv.xs.XSSimpleTypeDecl ;
> ./xsd/XSDDatatype.java:import 
> org.apache.xerces.impl.validation.ValidationState ;
> ./xsd/XSDhexBinary.java:import org.apache.xerces.impl.dv.util.HexBin ;
> ./xsd/XSDbase64Binary.java:import org.apache.xerces.impl.dv.util.Base64 ;
> ./xsd/impl/XSDGenericType.java:import org.apache.xerces.impl.dv.XSSimpleType;
> {code}
> It is not good style to depend on *.impl of a package - it is liable to fall 
> over at some point.  jena-osgi complains, but works in this particular case, 
> because xercesImpl is shadowed in.
> Some/all of these (base64) are available through more official packages - 
> org.apache.commons.codec.binary.Base64 comes to mind.
> https://commons.apache.org/proper/commons-codec/apidocs/org/apache/commons/codec/binary/Base64.html
> https://commons.apache.org/proper/commons-codec/apidocs/org/apache/commons/codec/binary/Hex.html
> So this task suggests to replace these dependencies with commons-codec 
> versions. Remember to add commons-codec to jena-osgi as well!  



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to