-
-
Notifications
You must be signed in to change notification settings - Fork 190
Align DOM implementations with org.w3c.dom #5740
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some parts could be converted to switch expressions
extensions/modules/mail/src/main/java/org/exist/xquery/modules/mail/MessageListFunctions.java
Show resolved
Hide resolved
extensions/modules/mail/src/main/java/org/exist/xquery/modules/mail/MessageListFunctions.java
Show resolved
Hide resolved
extensions/modules/mail/src/main/java/org/exist/xquery/modules/mail/MessageListFunctions.java
Show resolved
Hide resolved
extensions/modules/mail/src/main/java/org/exist/xquery/modules/mail/MessageListFunctions.java
Show resolved
Hide resolved
Interestingly, this work looks very similar to the previous work done in Elemental on March 17 2025, see here - evolvedbinary/elemental@f8a2781#diff-5b0c3e472fee91090782d0d1535d50f290ac6f450e8fbe68b30c9dcfad1b6505 I have no problem with you (or anyone else) taking code from Elemental, as long as you follow the license terms. That particular code in Elemental is partly under the LGPL 2.1 ONLY license with an 'Evolved Binary' Copyright. This is not the same license used by eXist-db (which is straight LGPL 2.1 (without the ONLY clause)), and it is not the same Copyright. If you wish to reuse Elemental code in eXist-db, please do, but you must follow the terms of the LGPL, so as I understand it, at a minimum, you would need to include our license header too in each file where you use our code, and a statement from yourselves if you have made any modifications to our code. You may also need to seek guidance on combining 'LGPL 2.1 ONLY' and 'LGPL 2.1' code as I suspect the outcome of that product is 'LGPL 2.1 ONLY' which is not the license that eXist-db currently claims. |
The license changes in the referenced commit are questionable and I did the changes on my own. |
@adamretter I would be very careful pointing to different licenses and accusing @line-o to have copied from Elemental here.
|
@line-o I don't yet understand what you mean by "questionable". Do you have questions about them? or do you believe there is a problem with our approach to licensing? We have worked hard to make sure we have followed and complied with the terms of the LGPL 2.1 license. If you believe that there is an issue with our licensing, please feel free to open an issue at https://github.com/evolvedbinary/elemental/issues with the specific details of your concerns in reference to the LGPL license terms.
I am not 'alleging' anything, I am simply making an observation. |
@reinhapa Can you tell me what I need to be 'careful' of please? The code for eXist-db is 'LGPL 2.1', the modifications in Elemental 6.4.0 and 7.0.0 are 'LGPL 2.1 ONLY'. I don't see how clearly pointing that out should upset anyone, in fact quite to the contrary, it is important for both developers and users to understand the licensing of the software they contribute to and/or use; they need to be 'careful' to adhere to the license terms.
I have not made any accusations, I have simply made an observation. If you compare the approach taken, and then also the git diffs you will likely find, as I did, that they are almost identical.
I don't disagree... but, there is more to it than just that here.
Elemental does contain the Git History of eXist-db - |
@line-o can you rebase this. The container test shows an error in |
fixes eXist-db#5672 Previously ElementImpl.getAttribute and ElementImpl.getAttributeNodeNS of in memory nodes violated the API contract of org.w3c.dom.element. It was returning null if an attribute was not set instead of an empty String. Fixing this lead to a host of changes throughout the project. The if-conditions are simplified and even flipped in a few locations were this greatly improved readability of thd code. The import of StringUtils was dropped were possible.
- refactor calculateBaseURI to use getAttributeNodeNS to differentiate between unset and empty attribute value - annotate functions with Nonnull that override Nonnull methods from org.w3c.dom.ElementImpl - remove deprecated function _getAttributeNS, - return "" instead on misleading constant in getAttributeNS
- drop dependency on Apache commons-lang3 - refactor AnalyzerConfig.getConstructorParameter and AnalyzerConfig.configureAnalyzer for readability
The last two were the mail module and the LDAP security realm.
- Eval.java and AppRestoreUtils
@duncdrum the error in docker startup persists. How can we inspect it locally? |
@line-o the logs aren't uploaded anymore automatically we should bring that back. You would have to build locally start the container and inspect its 'exist.log' There is an 'ERROR' that wasn't there before. |
so @duncdrum I think we caught an issue here which might be related to the changes:
|
dashboard has the speciality that it defines no version of the functx dependency so this feels very much related. |
When handling dependency elements in package descriptor files the package version attribute was checked in order to determine if a specific dependency version was pinned for this dependency. Now that the DOM implementation will always return an empty string instead of null for unset attributes this now means that 1. the package version is set (otherwise the package would not install) 2. the version variable for each dependency will be non-null because the package version is set. The type will then vary on the attribute value - this would have been null in the past and is now an empty string which changes the resulting DependemcyVersion subtype.
…ements - move private static class and private enum to the end of the class - remove unnecessary throw declaration from getPackageDir - flip if condition at the beginning of installAndDeploy - fix whitespace and formatting
@line-o nice catch, and yay for tests. Good to go now from my side. |
private static class RequestedPerms { | ||
final String user; | ||
final String password; | ||
final Optional<String> group; | ||
final Either<Integer, String> permissions; | ||
|
||
private RequestedPerms(final String user, final String password, final Optional<String> group, final Either<Integer, String> permissions) { | ||
this.user = user; | ||
this.password = password; | ||
this.group = group; | ||
this.permissions = permissions; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might use a record
instead of a class
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
makes sense, but I thought a 'switch' change would be in an upcoming PR... but I am wrong as I don't see a remark here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes let's not do too much in one PR.
Description:
This PR fixes inconsistencies in
with org.w3c.dom.ElementImpl
Because of that a lot of code throughout exist-db core and its extensions needed to be adapted.
So this is definitely a breaking change that developers of Java extensions need to take into account.
On the plus side this also enables us to get rid of a lot of extra checks that were necessary before.
As a result the dependency on apache.commons.lang3.StringUtils could be dropped in several modules.
Reference:
fixes #5672
Type of tests:
None added.