-
Bug
-
Resolution: Fixed
-
P3
-
None
-
b154
-
Verified
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8174470 | 10 | Andrey Nazarov | P3 | Resolved | Fixed | b01 |
There are two improvements that could be made to the tests for the Module attribute written by javac.
1. There are currently no tests for the "opens" directive and corresponding opens table in the Module attribute.
2. The testing for module names (and package names too) is weak/inverted and has allowed errors to go undetected. The tests all read names from the classfile, and then generally do .replace('/', '.') before comparing against the expected name in the descriptor. This checks most of the characters in the name, but it does _not_ check that the separator characters are correct. In other words, it does not check that '/' appears in the name when it should. (It checks that '/' or '.' appears where '/' should). It would be better to change the tests to apply .replace('.', '/') to the _expected_ name, rather than apply .replace('/', '.') to the actual name.
1. There are currently no tests for the "opens" directive and corresponding opens table in the Module attribute.
2. The testing for module names (and package names too) is weak/inverted and has allowed errors to go undetected. The tests all read names from the classfile, and then generally do .replace('/', '.') before comparing against the expected name in the descriptor. This checks most of the characters in the name, but it does _not_ check that the separator characters are correct. In other words, it does not check that '/' appears in the name when it should. (It checks that '/' or '.' appears where '/' should). It would be better to change the tests to apply .replace('.', '/') to the _expected_ name, rather than apply .replace('/', '.') to the actual name.
- backported by
-
JDK-8174470 update/improve testing of classfile module attribute
-
- Resolved
-