Project

Profile

Help

Revision eca87e2d

Added by Michael Kay about 10 years ago

3287522 Concurrent query compilation fails with NullPointerException

View differences:

latest9.3/hej/net/sf/saxon/Configuration.java
899 899

  
900 900
    public ConversionRules getConversionRules() {
901 901
        if (conversionRules == null) {
902
            conversionRules = new ConversionRules();
903
            conversionRules.setNameChecker(
904
                    xmlVersion == XML10 ?
905
                    Name10Checker.getInstance() :
906
                    Name11Checker.getInstance());
907
            conversionRules.setStringToDoubleConverter(
908
                    xsdVersion == XSD10 ?
909
                    StringToDouble.getInstance() :
910
                    StringToDouble11.getInstance());
911
            conversionRules.setNotationSet(this);
912
            if (xsdVersion == XSD10) {
913
                conversionRules.setURIChecker(StandardURIChecker.getInstance());
914
                // In XSD 1.1, there is no checking
915
            }
916
            conversionRules.setAllowYearZero(xsdVersion != XSD10);                 
902
            makeConversionRules();                 
917 903
        }
918 904
        return conversionRules;
919 905
    }
920 906

  
907
    private synchronized void makeConversionRules() {
908
        ConversionRules cv = new ConversionRules();
909
        cv.setNameChecker(
910
                xmlVersion == XML10 ?
911
                Name10Checker.getInstance() :
912
                Name11Checker.getInstance());
913
        cv.setStringToDoubleConverter(
914
                xsdVersion == XSD10 ?
915
                StringToDouble.getInstance() :
916
                StringToDouble11.getInstance());
917
        cv.setNotationSet(this);
918
        if (xsdVersion == XSD10) {
919
            cv.setURIChecker(StandardURIChecker.getInstance());
920
            // In XSD 1.1, there is no checking
921
        }
922
        cv.setAllowYearZero(xsdVersion != XSD10);
923
        conversionRules = cv;
924
    }
925

  
921 926
    /**
922 927
     * Get the version of XML Schema to be used
923 928
     * @return {@link #XSD10} or {@link #XSD11}

Also available in: Unified diff