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

Fix placeholder name for addition comparison test #985

Merged
merged 11 commits into from
Dec 11, 2024

Conversation

eggrobin
Copy link
Member

@eggrobin eggrobin commented Dec 9, 2024

See https://github.com/unicode-org/utc-release-management/issues/154.

Also get rid of some static variables whose initialization was unreliable.

@eggrobin eggrobin requested a review from markusicu December 9, 2024 17:59
@markusicu
Copy link
Member

https://github.com/unicode-org/unicodetools/actions/runs/12241473884/job/34146639916?pr=985

Error:  Tests run: 4, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 44.12 s <<< FAILURE! - in org.unicode.text.UCD.TestTestUnicodeInvariants
Error:  org.unicode.text.UCD.TestTestUnicodeInvariants.testAdditionComparisons  Time elapsed: 0.001 s  <<< ERROR!
java.lang.NullPointerException
	at org.unicode.text.UCD.TestTestUnicodeInvariants.testAdditionComparisons(TestTestUnicodeInvariants.java:47)

@eggrobin
Copy link
Member Author

eggrobin commented Dec 9, 2024

Hm, on my machine it seems to work…

@eggrobin eggrobin closed this Dec 9, 2024
@eggrobin eggrobin reopened this Dec 9, 2024
@eggrobin
Copy link
Member Author

/home/runner/work/unicodetools/unicodetools/unicodetools/mine/src/unicodetools/nullorg/unicode/text/UCD/AdditionComparisons does not exist

Well, I can believe that. But why did renaming this file cause src/main/resources/ to turn into null??

@eggrobin
Copy link
Member Author

eggrobin commented Dec 10, 2024

UnicodeTools.UNICODETOOLS_REPO_DIR=/home/runner/work/unicodetools/unicodetools/unicodetools/mine/src/, 
UnicodeTools.UNICODETOOLS_DIR=/home/runner/work/unicodetools/unicodetools/unicodetools/mine/src/unicodetools/, 
UnicodeTools.UNICODETOOLS_RSRC_DIR=/home/runner/work/unicodetools/unicodetools/unicodetools/mine/src/unicodetools/src/main/resources/, 
Settings.SRC_DIR=/home/runner/work/unicodetools/unicodetools/unicodetools/mine/src/unicodetools/nullorg/unicode/text/

@markusicu if this were C++ I would say « static initialization order fiasco », but I don’t know how this works in Java. Are you aware of similar pitfalls there? It sure looks like UnicodeTools.UNICODETOOLS_RSRC_DIR is not what it should be when it is used to initialize Settings.SRC_DIR, even though it eventually seems to hold the right value.

@markusicu
Copy link
Member

Java basically allows circular dependencies among classes, which can cause class initialization trouble.
AFAIK: As soon as a class is first used, it is loaded, running its class initialization code, and initializing fields top to bottom (I believe literally). But that can use other classes, and then those get initialized. If they in turn use the first class, then its initialization is incomplete, and some fields are still undefined/null.

@echeran @macchiati @josh-hadley for more ideas?

@eggrobin eggrobin merged commit f731c41 into unicode-org:main Dec 11, 2024
19 of 20 checks passed
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 this pull request may close these issues.

2 participants