Skip to content
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

JAVA 10 modules break old kludge #1209

Closed
Tomas-Kraus opened this issue Jul 13, 2018 · 4 comments · Fixed by #1402
Closed

JAVA 10 modules break old kludge #1209

Tomas-Kraus opened this issue Jul 13, 2018 · 4 comments · Fixed by #1402

Comments

@Tomas-Kraus
Copy link
Member

In my code, I have an old kludge:

/* restore the error count to 10 again, because we do not want to miss any errors! */
Glue.setPrivate(com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext.class,"errorsCounter",Integer.valueOf(10));

My Glue class uses reflection to set the value of a private member.
It became necessary, because in my code it is essential, that the system does not decide to throw any errors any more, after 10 of them have been encountered.

However, turning all of JAXB into modules (not a good idea in my opinion) will break that kludge, because private members in modules become inaccessible.

Therefore it becomes very important, that the old problem of limiting the number of exceptions with a static counter is fixed! (If nothing else appears acceptable, at least a system property should be introduced to suppress the decrementing of the counter.)

@Tomas-Kraus
Copy link
Member Author

lukasj added a commit to lukasj/jaxb-ri that referenced this issue Mar 15, 2020
lukasj added a commit that referenced this issue Mar 15, 2020
@lukasj
Copy link
Member

lukasj commented Mar 15, 2020

added com.sun.xml.bind.maxErrorsCount context property to increase or disable (using negative value) maximum number of errors reported by unmarshall operation

@christian-ertl
Copy link

Doesn't the change in 9effbd2 eliminate the performance fix?

@lukasj
Copy link
Member

lukasj commented May 12, 2020

@christian-ertl if you see that something is wrong, either file new bug or reopen existing. Without doing so it is very easy to miss it and ignore it. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants