-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[pull] master from erlang:master #225
Conversation
- Rewrote some recursion when calling continuation fun in xmerl_sax_parser_base. - Remove all old style catch calls in xmerl
* lars/xmerl/tail-recursion-bug-27/OTP-19496: Fix a tail recursion bug in sax parser
Reviewer's Guide by SourceryThis pull request replaces Sequence diagram for state2file functionsequenceDiagram
participant S as xsd_state record
participant M as xmerl_xsd module
participant E as ets table
S->M: state2file(S, FileName)
M->M: save_xsd_state(S)
M->E: ets:tab2file(S#xsd_state.table, FileName + ".xss")
alt ets:tab2file succeeds
E-->>M: ok
M-->>S: ok
else ets:tab2file fails
E-->>M: {error, Reason, StackTrace}
M-->>S: {error, {[], ?MODULE, {Reason, StackTrace}}}
end
Sequence diagram for validate3 functionsequenceDiagram
participant M as xmerl_xsd module
participant S as xsd_state record
participant V as validate_xml function
M->V: validate_xml(Xml, S)
alt validate_xml succeeds
V-->>M: {XML2, Rest, Sx}
M->M: lists:dropwhile(...)
alt lists:dropwhile returns empty list
M->M: return {Xml, S2}
else lists:dropwhile returns non-empty list
M->M: acc_errs(Sx, ...)
M->M: return {Xml, S2}
end
else validate_xml returns error
V-->>M: {error, Reason}
M->M: acc_errs(S, Reason)
M->M: return {Xml, S2}
else validate_xml throws error:Reason:StackTrace
V-->>M: error:Reason:StackTrace
M->M: acc_errs(S, ...)
M->M: return {Xml, S2}
else validate_xml throws exit:Reason
V-->>M: exit:Reason
M->M: acc_errs(S, ...)
M->M: return {Xml, S2}
end
M->M: save_to_file(S2, ...)
M->M: return S2#xsd_state.errors
Updated class diagram for xsd_stateclassDiagram
class xsd_state {
-table
-errors
-schema_name
-xsd_base
-num_el
-scope
-circularity_disallowed
-tab2file
+state2file(FileName)
+file2state(FileName)
+validate3(Schema, Xml)
+process_schema2(State, Schema)
+optional(Content)
+occurrence(El, Occ, S)
+check_any(E, Any, Env, S)
+check_substitutionGroups(SGs, S)
+check_cyclic_defs(S)
+merge_derived_types(Type1, Type2, Mode, S)
+qualified_name(Name, NS, Default, Scope)
+delete_table()
+print_table()
+save_to_file()
+save_in_table(Name, ElDef)
+get_schema_cm(Tab, Namespace)
+get_schema_cm1(Tab, Namespace)
+get_no_namespace_content(Tab)
}
note for xsd_state "This class represents the state of the XSD validator."
File-Level Changes
| Modified the
lib/xmerl/src/xmerl_xsd_type.erl || Modified the check_positive_integer function to use try-catch blocks instead of catch blocks to handle exceptions. |
lib/xmerl/src/xmerl_xsd_type.erl || Modified the check_base64Binary function to use try-catch blocks instead of catch blocks to handle exceptions. |
lib/xmerl/src/xmerl_xsd_type.erl || Modified the maxInclusive_fun function to use try-catch blocks instead of catch blocks to handle exceptions. |
lib/xmerl/src/xmerl_xsd_type.erl || Modified the maxExclusive_fun function to use try-catch blocks instead of catch blocks to handle exceptions. |
lib/xmerl/src/xmerl_xsd_type.erl || Modified the minExclusive_fun function to use try-catch blocks instead of catch blocks to handle exceptions. |
lib/xmerl/src/xmerl_xsd_type.erl || Modified the minInclusive_fun function to use try-catch blocks instead of catch blocks to handle exceptions. |
lib/xmerl/src/xmerl_xsd_type.erl || Modified the scan_number function to use try-catch blocks instead of catch blocks to handle exceptions. |
lib/xmerl/src/xmerl_xpath_pred.erl || Modified the check_elements function to use try-catch blocks instead of catch blocks to handle exceptions. |
lib/xmerl/src/xmerl_scan.erl || Modified the scan_reference function to use try-catch blocks instead of catch blocks to handle exceptions. |
lib/xmerl/src/xmerl_scan.erl || Modified the validate function to use try-catch blocks instead of catch blocks to handle exceptions. |
lib/xmerl/src/xmerl_validate.erl || Modified the parse function to use try-catch blocks instead of catch blocks to handle exceptions. |
lib/xmerl/src/xmerl_validate.erl || Modified the scanner_options function to use try-catch blocks instead of catch blocks to handle exceptions. |
lib/xmerl/src/xmerl_eventp.erlsrc lib/xmerl/src/xmerl_simple.erl || Modified the parse function to use try-catch blocks instead of catch blocks to handle exceptions. |
lib/xmerl/src/xmerl_regexp.erl |
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.1)
Can you help keep this open source service alive? 💖 Please sponsor : )
Summary by Sourcery
This pull request enhances the xmerl library by adding comprehensive error handling using try-catch blocks to prevent crashes and improve debugging information. It also addresses potential infinite loops caused by cyclic definitions in XML schemas.
Bug Fixes:
Enhancements: