Project

Profile

Help

Revision 4ee4355d

Added by O'Neil Delpratt 5 months ago

Saxon/C bug fixes with exception handling and other

View differences:

src/main/c/Saxon.C.API/SaxonProcessor.cpp
31 31
    return SaxonProcessor::sxn_environ->env->ExceptionCheck() || exception != nullptr;
32 32
}
33 33

  
34
const char *SaxonProcessor::checkException(jobject cpp) {
34
const char *SaxonProcessor::checkException() {
35 35
    const char *message = nullptr;
36
    message = checkForException(sxn_environ, cpp);
36
    message = checkForException(sxn_environ);
37 37
    return message;
38 38
}
39 39

  
......
792 792
        /*clearParameters();
793 793
        clearProperties();*/
794 794
    } else {
795
//#ifdef DEBUG
795
#ifdef DEBUG
796 796
        std::cerr << "SaxonProc: JVM finalize not called!" << std::endl;
797
//#endif
797
#endif
798 798
    }
799 799
}
800 800

  
......
814 814
    }
815 815
    jobject obj2 = (jobject) (SaxonProcessor::sxn_environ->env->NewObject(xdmAtomicClass, mssID_atomic, obj));
816 816
    XdmAtomicValue *value = new XdmAtomicValue(obj2, "xs:string");
817
    SaxonProcessor::sxn_environ->env->DeleteLocalRef(obj);
818
    SaxonProcessor::sxn_environ->env->DeleteLocalRef(obj2);
817 819
    return value;
818 820
}
819 821

  
......
830 832
    }
831 833
    jobject obj2 = (jobject) (SaxonProcessor::sxn_environ->env->NewObject(xdmAtomicClass, msID_atomic, obj));
832 834
    XdmAtomicValue *value = new XdmAtomicValue(obj2, "xs:string");
835
    SaxonProcessor::sxn_environ->env->DeleteLocalRef(obj);
833 836
    return value;
834 837
}
835 838

  
......
845 848
    }
846 849
    jobject obj = (jobject) (SaxonProcessor::sxn_environ->env->NewObject(xdmAtomicClass, miiID_atomic, (jlong) i));
847 850
    XdmAtomicValue *value = new XdmAtomicValue(obj, "Q{http://www.w3.org/2001/XMLSchema}integer");
851
    SaxonProcessor::sxn_environ->env->DeleteLocalRef(obj);
848 852
    return value;
849 853
}
850 854

  
......
856 860
    }
857 861
    jobject obj = (jobject) (SaxonProcessor::sxn_environ->env->NewObject(xdmAtomicClass, mdID_atomic, (jdouble) d));
858 862
    XdmAtomicValue *value = new XdmAtomicValue(obj, "Q{http://www.w3.org/2001/XMLSchema}double");
863
    SaxonProcessor::sxn_environ->env->DeleteLocalRef(obj);
859 864
    return value;
860 865
}
861 866

  
......
867 872
    }
868 873
    jobject obj = (jobject) (SaxonProcessor::sxn_environ->env->NewObject(xdmAtomicClass, mfID_atomic, (jfloat) d));
869 874
    XdmAtomicValue *value = new XdmAtomicValue(obj, "Q{http://www.w3.org/2001/XMLSchema}float");
875
    SaxonProcessor::sxn_environ->env->DeleteLocalRef(obj);
870 876
    return value;
871 877
}
872 878

  
......
878 884
    }
879 885
    jobject obj = (jobject) (SaxonProcessor::sxn_environ->env->NewObject(xdmAtomicClass, mlID_atomic, (jlong) l));
880 886
    XdmAtomicValue *value = new XdmAtomicValue(obj, "Q{http://www.w3.org/2001/XMLSchema}long");
887
    SaxonProcessor::sxn_environ->env->DeleteLocalRef(obj);
881 888
    return value;
882 889
}
883 890

  
......
889 896
    }
890 897
    jobject obj = (jobject) (SaxonProcessor::sxn_environ->env->NewObject(xdmAtomicClass, mID_atomic, (jboolean) b));
891 898
    XdmAtomicValue *value = new XdmAtomicValue(obj, "Q{http://www.w3.org/2001/XMLSchema}boolean");
899
    SaxonProcessor::sxn_environ->env->DeleteLocalRef(obj);
892 900
    return value;
893 901
}
894 902

  
895 903
XdmAtomicValue *SaxonProcessor::makeQNameValue(const char *str) {
896 904
    jobject val = xdmValueAsObj(SaxonProcessor::sxn_environ, "QName", str);
897 905
    XdmAtomicValue *value = new XdmAtomicValue(val, "QName");
906
    SaxonProcessor::sxn_environ->env->DeleteLocalRef(val);
898 907
    return value;
899 908
}
900 909

  
901 910
XdmAtomicValue *SaxonProcessor::makeAtomicValue(const char *typei, const char *strValue) {
902 911
    jobject obj = xdmValueAsObj(SaxonProcessor::sxn_environ, typei, strValue);
903 912
    XdmAtomicValue *value = new XdmAtomicValue(obj, typei);
913
    SaxonProcessor::sxn_environ->env->DeleteLocalRef(obj);
904 914
    return value;
905 915
}
906 916

  

Also available in: Unified diff