RFR: 8255542: Attribute length of Module, ModulePackages and other attributes is ignored [v2]
Daniel Fuchs
dfuchs at openjdk.java.net
Thu Dec 3 15:54:59 UTC 2020
On Thu, 3 Dec 2020 12:50:56 GMT, Rémi Forax <github.com+828220+forax at openjdk.org> wrote:
>> Alan Bateman has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 11 additional commits since the last revision:
>>
>> - Restructure check to make it more obvious that it doesn't overflow
>> - Merge
>> - Merge
>> - Merge
>> - Trailing whitespace
>> - Expand test to Module attribute
>> - Merge
>> - Test cleanup
>> - Add test
>> - Merge
>> - ... and 1 more: https://git.openjdk.java.net/jdk/compare/5bb86f87...f15dbb1b
>
> src/java.base/share/classes/jdk/internal/module/ModuleInfo.java line 1203:
>
>> 1201: @Override
>> 1202: public String readUTF() throws IOException {
>> 1203: return DataInputStream.readUTF(this);
>
> If i understand correctly the code, I believe readUTF should change a boolean field named `countCanNotBeTrackedAnymore` from false to true, and in the method `count()`, `countCanNotBeTrackedAnymore` has to be checked and throws an ISE before returning `count`
Hi Rémi, I do not think that that is required. `DataInputStream.readUTF` will call back into `this` to do the reading so the `count` should be properly incremented? Or maybe I'm missing something. Best regards!
-------------
PR: https://git.openjdk.java.net/jdk/pull/1407
More information about the core-libs-dev
mailing list