On Wed, 7 Oct 2020 21:49:24 GMT, Yumin Qi <mi...@openjdk.org> wrote:

>> src/java.base/share/classes/jdk/internal/misc/CDS.java line 144:
>> 
>>> 142:             String line = s.trim();
>>> 143:             if (!line.startsWith("[LF_RESOLVE]") && 
>>> !line.startsWith("[SPECIES_RESOLVE]")) {
>>> 144:                 System.out.println("Wrong prefix: " + line);
>> 
>> Should this throw an exception instead?
>
> This part is for check the format only, throw exceptions will lead more 
> objects generated which should not be archived
> in shared heap. Since this is only called from VM, so decide not to throw 
> exception here.

The exception object will not be automatically added to the shared heap, so 
it's OK to throw exceptions here.

-------------

PR: https://git.openjdk.java.net/jdk/pull/193

Reply via email to