Conversation
type-casted values.
is missing. Xerces2RegPopularor did not work correctly whenever one of the optional attributes are missing. Using an empty string in that case.
for better readability.
where possible as we are going to change it anyway. However, avoided changes at public method signature to ensure backward compatibility.
by implementing all resources access using the try-with-resources code schema where possible and meaningful.
if implicitly requested by usage of the DefaultCompositeRegPopulator. Instead throwing a runtime exception . Restricted the check from null pointer check to empty list check, because in case of an empty list the subsequent code may cause the NPE seen in the tests after having applied the try-with-resources code schema strictly.
where possible. If not possible SuppressWarnig annotation had been added, e.g. on public APIs. Furthermore: - clean up not done for Xerces code as it will be removed - low hanging fruits taken, e.g. using StringBuilder instead of StringBuffer - improved initialization of singletons in jpos.profile - further code improvements to get less code smell (no complains for this old code...) Tests passed locally.
by restructuring the control flow.
like - bad constant referencing - StringBuffer usage - unnecessary casting
This is a backward incompatible change! But OK for the new major number 4.0. All deprecated since long time (1999) - jpos.config.simple.SimpleEntryRegistry parameterless constructor - jpos.loader.simple.SimpleServiceManager parameterless constructor - jpos.util.Tracer internal class
The new class JavaxRegPopulator extends the config loader with an XML populator that works with Javax instead of Xerces and thus enables JavaPOS to be used without the external modules of the Xalan / Xerces project.
according to discussion in #7. In addition to requested changes, string constant "jpos.xml" has been replaced by constant DEFAULT_XML_FILE_NAME in method save.
- Constants for path and names of DTD and XSD file and for the DTD document type value moved to XmlRegPopulator. - Constants for XML tag and attribute values added to XmlRegPopulator. - "Unchecked" warning suppressed for some methods. - Method getSortedList removed. Use Collections.sort directly instead. - Method notAttribute renamed to cannotSetAttributeOfTag for better understanding. - Comments for method cannotSetAttributeOfTag added. - LinkedList replaced by ArrayList where meaningful and vice versa.
The default SimpleXmlRegPopulator has been changed to use JavaxRegPopulator instead of XercesRegPoputator now. This allows to remove Xerces completely later on.
instance a different file. Solved by clearing the internal data structure, which was missing. Detected by adding a copy of XercesRegPopulatorTestCase which instantiates JavaxRegPopulator and fails for test jpos.config.simple.xml.JavaxRegPopulatorTestCase.testXercesPopulator1().
Some other source formatting cleanups.
for a more readable implementation as discussed at #7 (comment)
Note, there is still a compiler warning at this changed lines requesting to use generic types. This is already fixed with branch fixes-from-pr7 and will work out when merging both branches together on the main.
Code cleanup: Defined a constant for that restriction rule attribute.
Affected methods are - findFileInJarZipFiles(String fileName, Vector<String> jarZipFilesVector) restored, forwarding to the new method findFileInJarZipFiles( String fileName, List<String> jarZipFilesList ) - getJposEntries() conceptually substituted by methods addJposEntry(String logicalName, JposEntry entry) and clearAllJposEntries() Both old reintroduced methods has been marked as deprecated, however, pointing to the new methods.
No semantic changes at all.
DefaultProfileFactory.java is a copy of XercesProfilefactory from the fixes-from-pr7 branch coming with a lot of code clean up. At SimpleServiceManager.java the instantiation of the ProfileFactory has been changed to the new DefaultProfileFactory.
Follow up to the previous commit.
|
@mjpcger, do you want to review this pull request before I'm merging it? Most of the work is from your contribution... I would, however, publish a pre-release of the original branch to Maven Central such that it can be verified in local build environments. |
mjpcger
left a comment
There was a problem hiding this comment.
Se.ems to be good, only some JavaDoc comments should not remain empty
as requested by reviewer. They had been added automatically by Eclipse when generating the serial UID to solve compiler warnings. A comment would be meaningsless at the end here...
|
@mjpcger could you please make a final review and approve the PR, please? I could merge without your approval (because I'm the project admin 😄), however, I would like to try the "clean" process way... |
|
A RC built from this PR has been published to Maven Central's snapshot repository at https://oss.sonatype.org/content/repositories/snapshots/org/javapos/javapos-config-loader/4.0.0-SNAPSHOT/. It may be downloaded from there or resolved by dependency resolution if configured appropriately, e.g. for Gradle: Who ever is interested, please integrate in your environment for testing purposes and report back any issue here in this PR. |
mjpcger
left a comment
There was a problem hiding this comment.
Looks good for me, no change necessary.
|
More approval is not possible for me. Looks as if I have no write access and therefore my approval is not enough to change the Review required status. |
|
Thanks, @mjpcger! |
|
Who ever is interested: We just encountered in our off-side integration test that some of our JavaPOS XML configuration files are not read in correctly by the new javapos-config-loader-4.0.0-RC1, Those were read in without errors by the Xerces implementation, however. We are investigating... |
|
The reported regression was a misinterpretation. In fact, it new XML populator is just more accurate. If the DTD is given in the JavaPOS XML configuration file like ´´´ |
|
I improved the tracing a bit. So, I'm going to publish a new SNAPSHOT on Maven Central's snapshot repository - RC2. |
which is the same implementation, just another name to get rid of "Xerces" in the name. In fact, it was forgotten to remove the old file when renaming it.
in case there is a configuration error which can not be recovered from.
by refactoring out code to private methods for better readability.

This PR is intended to implement the new major version 4 of javapos-config-loader incorporating the following major changes