RFR: 8263632: Improve exception handling of APIs in classLoader.cpp

classic Classic list List threaded Threaded
17 messages Options
Reply | Threaded
Open this post in threaded view
|

RFR: 8263632: Improve exception handling of APIs in classLoader.cpp

Calvin Cheung
Please review this change which includes:

-  adding `ClassLoader::create_class_path_entry_or_fail()` and `ClassLoader::create_class_path_entry_or_fail()` functions for better readability. They will call the existing `ClassLoader::create_class_path_entry()`.
- replacing the TRAPS parameter with `Thread* current` for the functions which never throw exception.

Testing: tiers 1,2 (passed); tiers 3,4 (in progress).

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

Commit messages:
 - 8263632: Improve exception handling of APIs in classLoader.cpp

Changes: https://git.openjdk.java.net/jdk/pull/3203/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=3203&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8263632
  Stats: 54 lines in 6 files changed: 24 ins; 6 del; 24 mod
  Patch: https://git.openjdk.java.net/jdk/pull/3203.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/3203/head:pull/3203

PR: https://git.openjdk.java.net/jdk/pull/3203
Reply | Threaded
Open this post in threaded view
|

Re: RFR: 8263632: Improve exception handling of APIs in classLoader.cpp

Ioi Lam-2
On Thu, 25 Mar 2021 18:42:37 GMT, Calvin Cheung <[hidden email]> wrote:

> Please review this change which includes:
>
> -  adding `ClassLoader::create_class_path_entry_or_fail()` and `ClassLoader::create_class_path_entry_or_fail()` functions for better readability. They will call the existing `ClassLoader::create_class_path_entry()`.
> - replacing the TRAPS parameter with `Thread* current` for the functions which never throw exception.
>
> Testing: tiers 1,2 (passed); tiers 3,4 (in progress).

Changes requested by iklam (Reviewer).

src/hotspot/share/classfile/classLoader.cpp line 554:

> 552:   // File or directory found
> 553:   ClassPathEntry* new_entry = NULL;
> 554:   new_entry = create_class_path_entry_or_fail(path, &st,

Ideally, there's should be no need to check for new_entry == NULL when calling  calling create_class_path_entry_or_fail(). This will make the code easier to read.

But currently the create_class_path_entry_or_fail() is still "tri-state":

- success: non-null
- throw vmSymbols::java_io_IOException()
- return NULL

The third case is this:

        // Don't complain about bad jar files added via -Xbootclasspath/a:.
        if (throw_exception && is_init_completed()) {
          THROW_MSG_(vmSymbols::java_lang_ClassNotFoundException(), msg, NULL);
        } else {
          return NULL; <<<<< here
        }

I am wondering if we can get rid of this logic. That way, we can add asserts like:

ClassPathEntry* ClassLoader::create_class_path_entry_or_fail(...) {
  ClassPathEntry* entry = create_class_path_entry(, THREAD);
  assert(entry != NULL || HAS_PENDING_EXCEPTION, "must throw or return valid entry");
  return entry;
}

ClassPathEntry* ClassLoader::create_class_path_entry_or_null(...) {
  ClassPathEntry* entry = create_class_path_entry(, current);
  assert(!HAS_PENDING_EXCEPTION, "must not throw");
  return entry;
}

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

PR: https://git.openjdk.java.net/jdk/pull/3203
Reply | Threaded
Open this post in threaded view
|

Re: RFR: 8263632: Improve exception handling of APIs in classLoader.cpp

David Holmes-2
On Thu, 25 Mar 2021 20:05:55 GMT, Ioi Lam <[hidden email]> wrote:

>> Please review this change which includes:
>>
>> -  adding `ClassLoader::create_class_path_entry_or_fail()` and `ClassLoader::create_class_path_entry_or_fail()` functions for better readability. They will call the existing `ClassLoader::create_class_path_entry()`.
>> - replacing the TRAPS parameter with `Thread* current` for the functions which never throw exception.
>>
>> Testing: tiers 1,2 (passed); tiers 3,4 (in progress).
>
> src/hotspot/share/classfile/classLoader.cpp line 554:
>
>> 552:   // File or directory found
>> 553:   ClassPathEntry* new_entry = NULL;
>> 554:   new_entry = create_class_path_entry_or_fail(path, &st,
>
> Ideally, there's should be no need to check for new_entry == NULL when calling  calling create_class_path_entry_or_fail(). This will make the code easier to read.
>
> But currently the create_class_path_entry_or_fail() is still "tri-state":
>
> - success: non-null
> - throw vmSymbols::java_io_IOException()
> - return NULL
>
> The third case is this:
>
>         // Don't complain about bad jar files added via -Xbootclasspath/a:.
>         if (throw_exception && is_init_completed()) {
>           THROW_MSG_(vmSymbols::java_lang_ClassNotFoundException(), msg, NULL);
>         } else {
>           return NULL; <<<<< here
>         }
>
> I am wondering if we can get rid of this logic. That way, we can add asserts like:
>
> ClassPathEntry* ClassLoader::create_class_path_entry_or_fail(...) {
>   ClassPathEntry* entry = create_class_path_entry(, THREAD);
>   assert(entry != NULL || HAS_PENDING_EXCEPTION, "must throw or return valid entry");
>   return entry;
> }
>
> ClassPathEntry* ClassLoader::create_class_path_entry_or_null(...) {
>   ClassPathEntry* entry = create_class_path_entry(, current);
>   assert(!HAS_PENDING_EXCEPTION, "must not throw");
>   return entry;
> }

You can't use HAS_PENDING_EXCEPTION in create_class_path_entry_or_null without reintroducing THREAD.

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

PR: https://git.openjdk.java.net/jdk/pull/3203
Reply | Threaded
Open this post in threaded view
|

Re: RFR: 8263632: Improve exception handling of APIs in classLoader.cpp

David Holmes-2
In reply to this post by Calvin Cheung
On Thu, 25 Mar 2021 18:42:37 GMT, Calvin Cheung <[hidden email]> wrote:

> Please review this change which includes:
>
> -  adding `ClassLoader::create_class_path_entry_or_fail()` and `ClassLoader::create_class_path_entry_or_fail()` functions for better readability. They will call the existing `ClassLoader::create_class_path_entry()`.
> - replacing the TRAPS parameter with `Thread* current` for the functions which never throw exception.
>
> Testing: tiers 1,2 (passed); tiers 3,4 (in progress).

LGTM!

Thanks,
David

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

Marked as reviewed by dholmes (Reviewer).

PR: https://git.openjdk.java.net/jdk/pull/3203
Reply | Threaded
Open this post in threaded view
|

Re: RFR: 8263632: Improve exception handling of APIs in classLoader.cpp [v2]

Calvin Cheung
In reply to this post by Calvin Cheung
> Please review this change which includes:
>
> -  adding `ClassLoader::create_class_path_entry_or_fail()` and `ClassLoader::create_class_path_entry_or_fail()` functions for better readability. They will call the existing `ClassLoader::create_class_path_entry()`.
> - replacing the TRAPS parameter with `Thread* current` for the functions which never throw exception.
>
> Testing: tiers 1,2 (passed); tiers 3,4 (in progress).

Calvin Cheung has updated the pull request incrementally with one additional commit since the last revision:

  get rid of throw_exception in ClassLoader::create_class_path_entry

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

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/3203/files
  - new: https://git.openjdk.java.net/jdk/pull/3203/files/52632b62..c2d1cde7

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=3203&range=01
 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=3203&range=00-01

  Stats: 132 lines in 6 files changed: 9 ins; 52 del; 71 mod
  Patch: https://git.openjdk.java.net/jdk/pull/3203.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/3203/head:pull/3203

PR: https://git.openjdk.java.net/jdk/pull/3203
Reply | Threaded
Open this post in threaded view
|

Re: RFR: 8263632: Improve exception handling of APIs in classLoader.cpp [v2]

Calvin Cheung
In reply to this post by David Holmes-2
On Fri, 26 Mar 2021 06:14:01 GMT, David Holmes <[hidden email]> wrote:

> LGTM!
>
> Thanks,
> David

Thanks David.

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

PR: https://git.openjdk.java.net/jdk/pull/3203
Reply | Threaded
Open this post in threaded view
|

Re: RFR: 8263632: Improve exception handling of APIs in classLoader.cpp [v2]

Calvin Cheung
In reply to this post by David Holmes-2
On Fri, 26 Mar 2021 06:04:38 GMT, David Holmes <[hidden email]> wrote:

>> src/hotspot/share/classfile/classLoader.cpp line 554:
>>
>>> 552:   // File or directory found
>>> 553:   ClassPathEntry* new_entry = NULL;
>>> 554:   new_entry = create_class_path_entry_or_fail(path, &st,
>>
>> Ideally, there's should be no need to check for new_entry == NULL when calling  calling create_class_path_entry_or_fail(). This will make the code easier to read.
>>
>> But currently the create_class_path_entry_or_fail() is still "tri-state":
>>
>> - success: non-null
>> - throw vmSymbols::java_io_IOException()
>> - return NULL
>>
>> The third case is this:
>>
>>         // Don't complain about bad jar files added via -Xbootclasspath/a:.
>>         if (throw_exception && is_init_completed()) {
>>           THROW_MSG_(vmSymbols::java_lang_ClassNotFoundException(), msg, NULL);
>>         } else {
>>           return NULL; <<<<< here
>>         }
>>
>> I am wondering if we can get rid of this logic. That way, we can add asserts like:
>>
>> ClassPathEntry* ClassLoader::create_class_path_entry_or_fail(...) {
>>   ClassPathEntry* entry = create_class_path_entry(, THREAD);
>>   assert(entry != NULL || HAS_PENDING_EXCEPTION, "must throw or return valid entry");
>>   return entry;
>> }
>>
>> ClassPathEntry* ClassLoader::create_class_path_entry_or_null(...) {
>>   ClassPathEntry* entry = create_class_path_entry(, current);
>>   assert(!HAS_PENDING_EXCEPTION, "must not throw");
>>   return entry;
>> }
>
> You can't use HAS_PENDING_EXCEPTION in create_class_path_entry_or_null without reintroducing THREAD.

After offline discussion with Ioi, we've decided to get rid of the `throw_exception` in `create_class_path_entry()`. This makes the code cleaner. We could also drop the `TRAPS` parameter of a few other related functions.

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

PR: https://git.openjdk.java.net/jdk/pull/3203
Reply | Threaded
Open this post in threaded view
|

Re: RFR: 8263632: Improve exception handling of APIs in classLoader.cpp [v2]

Coleen Phillimore-3
In reply to this post by Calvin Cheung
On Fri, 26 Mar 2021 16:11:45 GMT, Calvin Cheung <[hidden email]> wrote:

>> Please review this change which includes:
>>
>> -  adding `ClassLoader::create_class_path_entry_or_fail()` and `ClassLoader::create_class_path_entry_or_fail()` functions for better readability. They will call the existing `ClassLoader::create_class_path_entry()`.
>> - replacing the TRAPS parameter with `Thread* current` for the functions which never throw exception.
>>
>> Testing: tiers 1,2 (passed); tiers 3,4 (in progress).
>
> Calvin Cheung has updated the pull request incrementally with one additional commit since the last revision:
>
>   get rid of throw_exception in ClassLoader::create_class_path_entry

Looks good.

src/hotspot/share/classfile/classLoader.cpp line 519:

> 517:   Arguments::assert_is_dumping_archive();
> 518:
> 519:   ResourceMark rm;

You can add 'current' as a parameter to ResourceMark since you have it.

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

Marked as reviewed by coleenp (Reviewer).

PR: https://git.openjdk.java.net/jdk/pull/3203
Reply | Threaded
Open this post in threaded view
|

Re: RFR: 8263632: Improve exception handling of APIs in classLoader.cpp [v3]

Calvin Cheung
In reply to this post by Calvin Cheung
> Please review this change which includes:
>
> -  adding `ClassLoader::create_class_path_entry_or_fail()` and `ClassLoader::create_class_path_entry_or_fail()` functions for better readability. They will call the existing `ClassLoader::create_class_path_entry()`.
> - replacing the TRAPS parameter with `Thread* current` for the functions which never throw exception.
>
> Testing: tiers 1,2 (passed); tiers 3,4 (in progress).

Calvin Cheung has updated the pull request incrementally with one additional commit since the last revision:

  @coleenp review comment

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

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/3203/files
  - new: https://git.openjdk.java.net/jdk/pull/3203/files/c2d1cde7..9bf7c0b0

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=3203&range=02
 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=3203&range=01-02

  Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod
  Patch: https://git.openjdk.java.net/jdk/pull/3203.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/3203/head:pull/3203

PR: https://git.openjdk.java.net/jdk/pull/3203
Reply | Threaded
Open this post in threaded view
|

Re: RFR: 8263632: Improve exception handling of APIs in classLoader.cpp [v2]

Calvin Cheung
In reply to this post by Coleen Phillimore-3
On Fri, 26 Mar 2021 16:14:40 GMT, Coleen Phillimore <[hidden email]> wrote:

>> Calvin Cheung has updated the pull request incrementally with one additional commit since the last revision:
>>
>>   get rid of throw_exception in ClassLoader::create_class_path_entry
>
> src/hotspot/share/classfile/classLoader.cpp line 519:
>
>> 517:   Arguments::assert_is_dumping_archive();
>> 518:
>> 519:   ResourceMark rm;
>
> You can add 'current' as a parameter to ResourceMark since you have it.

Thanks Coleen.
I've fixed it.

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

PR: https://git.openjdk.java.net/jdk/pull/3203
Reply | Threaded
Open this post in threaded view
|

Re: RFR: 8263632: Improve exception handling of APIs in classLoader.cpp [v3]

Ioi Lam-2
In reply to this post by Calvin Cheung
On Fri, 26 Mar 2021 16:47:39 GMT, Calvin Cheung <[hidden email]> wrote:

>> Please review this change which includes:
>>
>> -  adding `ClassLoader::create_class_path_entry_or_fail()` and `ClassLoader::create_class_path_entry_or_fail()` functions for better readability. They will call the existing `ClassLoader::create_class_path_entry()`.
>> - replacing the TRAPS parameter with `Thread* current` for the functions which never throw exception.
>>
>> Testing: tiers 1,2 (passed); tiers 3,4 (in progress).
>
> Calvin Cheung has updated the pull request incrementally with one additional commit since the last revision:
>
>   @coleenp review comment

LGTM. Just one small nit.

src/hotspot/share/classfile/classLoader.cpp line 559:

> 557:     add_to_module_path_entries(path, new_entry);
> 558:   }
> 559:   return;

nit: return is no longer needed.

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

Marked as reviewed by iklam (Reviewer).

PR: https://git.openjdk.java.net/jdk/pull/3203
Reply | Threaded
Open this post in threaded view
|

Re: RFR: 8263632: Improve exception handling of APIs in classLoader.cpp [v4]

Calvin Cheung
In reply to this post by Calvin Cheung
> Please review this change which includes:
>
> -  adding `ClassLoader::create_class_path_entry_or_fail()` and `ClassLoader::create_class_path_entry_or_fail()` functions for better readability. They will call the existing `ClassLoader::create_class_path_entry()`.
> - replacing the TRAPS parameter with `Thread* current` for the functions which never throw exception.
>
> Testing: tiers 1,2 (passed); tiers 3,4 (in progress).

Calvin Cheung has updated the pull request incrementally with one additional commit since the last revision:

  @iklam review comment

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

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/3203/files
  - new: https://git.openjdk.java.net/jdk/pull/3203/files/9bf7c0b0..76932cc3

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=3203&range=03
 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=3203&range=02-03

  Stats: 1 line in 1 file changed: 0 ins; 1 del; 0 mod
  Patch: https://git.openjdk.java.net/jdk/pull/3203.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/3203/head:pull/3203

PR: https://git.openjdk.java.net/jdk/pull/3203
Reply | Threaded
Open this post in threaded view
|

Re: RFR: 8263632: Improve exception handling of APIs in classLoader.cpp [v3]

Calvin Cheung
In reply to this post by Ioi Lam-2
On Fri, 26 Mar 2021 17:02:44 GMT, Ioi Lam <[hidden email]> wrote:

>> Calvin Cheung has updated the pull request incrementally with one additional commit since the last revision:
>>
>>   @coleenp review comment
>
> src/hotspot/share/classfile/classLoader.cpp line 559:
>
>> 557:     add_to_module_path_entries(path, new_entry);
>> 558:   }
>> 559:   return;
>
> nit: return is no longer needed.

Thanks Ioi.
I've fixed it.

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

PR: https://git.openjdk.java.net/jdk/pull/3203
Reply | Threaded
Open this post in threaded view
|

Integrated: 8263632: Improve exception handling of APIs in classLoader.cpp

Calvin Cheung
In reply to this post by Calvin Cheung
On Thu, 25 Mar 2021 18:42:37 GMT, Calvin Cheung <[hidden email]> wrote:

> Please review this change which includes:
>
> -  adding `ClassLoader::create_class_path_entry_or_fail()` and `ClassLoader::create_class_path_entry_or_fail()` functions for better readability. They will call the existing `ClassLoader::create_class_path_entry()`.
> - replacing the TRAPS parameter with `Thread* current` for the functions which never throw exception.
>
> Testing: tiers 1,2 (passed); tiers 3,4 (in progress).

This pull request has now been integrated.

Changeset: c9d2d024
Author:    Calvin Cheung <[hidden email]>
URL:       https://git.openjdk.java.net/jdk/commit/c9d2d024
Stats:     136 lines in 8 files changed: 11 ins; 37 del; 88 mod

8263632: Improve exception handling of APIs in classLoader.cpp

Reviewed-by: iklam, dholmes, coleenp

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

PR: https://git.openjdk.java.net/jdk/pull/3203
Reply | Threaded
Open this post in threaded view
|

Re: RFR: 8263632: Improve exception handling of APIs in classLoader.cpp [v4]

David Holmes-2
In reply to this post by Calvin Cheung
On Fri, 26 Mar 2021 16:12:54 GMT, Calvin Cheung <[hidden email]> wrote:

>> You can't use HAS_PENDING_EXCEPTION in create_class_path_entry_or_null without reintroducing THREAD.
>
> After offline discussion with Ioi, we've decided to get rid of the `throw_exception` in `create_class_path_entry()`. This makes the code cleaner. We could also drop the `TRAPS` parameter of a few other related functions.

It is not at all clear to me how you now deal with the error cases without exceptions. How is it detected that ClassLoader::setup_module_search_path failed for example?

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

PR: https://git.openjdk.java.net/jdk/pull/3203
Reply | Threaded
Open this post in threaded view
|

Re: RFR: 8263632: Improve exception handling of APIs in classLoader.cpp [v4]

Ioi Lam
On 3/28/21 9:40 PM, David Holmes wrote:
> On Fri, 26 Mar 2021 16:12:54 GMT, Calvin Cheung <[hidden email]> wrote:
>
>>> You can't use HAS_PENDING_EXCEPTION in create_class_path_entry_or_null without reintroducing THREAD.
>> After offline discussion with Ioi, we've decided to get rid of the `throw_exception` in `create_class_path_entry()`. This makes the code cleaner. We could also drop the `TRAPS` parameter of a few other related functions.
> It is not at all clear to me how you now deal with the error cases without exceptions. How is it detected that ClassLoader::setup_module_search_path failed for example?
>

During VM bootstrap, classLoader.cpp tries to open files on related to
-Xbootclasspath/a: and --patch-module.

For --patch-module handling, throw_exception=false was specified.

For bootclasspath handling, throw_exception=true was specified before
JDK-8263632:

https://github.com/openjdk/jdk/blame/59ed1fa28c80395ddc5e8d8611e2225349aaff1a/src/hotspot/share/classfile/classLoader.cpp#L672

    ClassLoader::initialize
    -> ClassLoader::setup_bootstrap_search_path
    -> ClassLoader::setup_bootstrap_search_path_impl
    -> update_class_path_entry_list
    -> create_class_path_entry(path, &st, /*throw_exception=*/true, ...)

But this will not throw any exception for invalid JAR files:

    [1] the file doesn't exist.
    $ rm -f foo.jar
    $ java -Xbootclasspath/a:foo.jar -version
    openjdk version "15" 2020-09-15
    OpenJDK Runtime Environment (build 15+36-1562)
    OpenJDK 64-Bit Server VM (build 15+36-1562, mixed mode, sharing)


    [2] the file exists but is not a ZIP file
    $ touch foo.jar
    $ java -Xbootclasspath/a:foo.jar -version
    openjdk version "15" 2020-09-15
    OpenJDK Runtime Environment (build 15+36-1562)
    OpenJDK 64-Bit Server VM (build 15+36-1562, mixed mode, sharing)


The behavior of [2] is due to this: is_init_completed() is false during
VM bootstrap.

    // Don't complain about bad jar files added via -Xbootclasspath/a:.
    if (throw_exception && is_init_completed()) {
      THROW_MSG_(vmSymbols::java_lang_ClassNotFoundException(), msg, NULL);
    } else {
      return NULL;
    }


create_class_path_entry() is called when is_init_completed() is true
only during CDS dumping code. We decided that we don't need the
exception in this case and will just ignore any non-existing or invalid
ZIP files. Getting rid of the throw_exception parameter makes things a
lot simpler.

Thanks
- Ioi

> -------------
>
> PR: https://git.openjdk.java.net/jdk/pull/3203

Reply | Threaded
Open this post in threaded view
|

Re: RFR: 8263632: Improve exception handling of APIs in classLoader.cpp [v4]

David Holmes
On 30/03/2021 9:01 am, Ioi Lam wrote:

> On 3/28/21 9:40 PM, David Holmes wrote:
>> On Fri, 26 Mar 2021 16:12:54 GMT, Calvin Cheung <[hidden email]>
>> wrote:
>>
>>>> You can't use HAS_PENDING_EXCEPTION in
>>>> create_class_path_entry_or_null without reintroducing THREAD.
>>> After offline discussion with Ioi, we've decided to get rid of the
>>> `throw_exception` in `create_class_path_entry()`. This makes the code
>>> cleaner. We could also drop the `TRAPS` parameter of a few other
>>> related functions.
>> It is not at all clear to me how you now deal with the error cases
>> without exceptions. How is it detected that
>> ClassLoader::setup_module_search_path failed for example?
>>
>
> During VM bootstrap, classLoader.cpp tries to open files on related to
> -Xbootclasspath/a: and --patch-module.
>
> For --patch-module handling, throw_exception=false was specified.
>
> For bootclasspath handling, throw_exception=true was specified before
> JDK-8263632:
>
> https://github.com/openjdk/jdk/blame/59ed1fa28c80395ddc5e8d8611e2225349aaff1a/src/hotspot/share/classfile/classLoader.cpp#L672 
>
>
>     ClassLoader::initialize
>     -> ClassLoader::setup_bootstrap_search_path
>     -> ClassLoader::setup_bootstrap_search_path_impl
>     -> update_class_path_entry_list
>     -> create_class_path_entry(path, &st, /*throw_exception=*/true, ...)
>
> But this will not throw any exception for invalid JAR files:
>
>     [1] the file doesn't exist.
>     $ rm -f foo.jar
>     $ java -Xbootclasspath/a:foo.jar -version
>     openjdk version "15" 2020-09-15
>     OpenJDK Runtime Environment (build 15+36-1562)
>     OpenJDK 64-Bit Server VM (build 15+36-1562, mixed mode, sharing)
>
>
>     [2] the file exists but is not a ZIP file
>     $ touch foo.jar
>     $ java -Xbootclasspath/a:foo.jar -version
>     openjdk version "15" 2020-09-15
>     OpenJDK Runtime Environment (build 15+36-1562)
>     OpenJDK 64-Bit Server VM (build 15+36-1562, mixed mode, sharing)
>
>
> The behavior of [2] is due to this: is_init_completed() is false during
> VM bootstrap.
>
>     // Don't complain about bad jar files added via -Xbootclasspath/a:.
>     if (throw_exception && is_init_completed()) {
>       THROW_MSG_(vmSymbols::java_lang_ClassNotFoundException(), msg, NULL);
>     } else {
>       return NULL;
>     }
>
>
> create_class_path_entry() is called when is_init_completed() is true
> only during CDS dumping code. We decided that we don't need the
> exception in this case and will just ignore any non-existing or invalid
> ZIP files. Getting rid of the throw_exception parameter makes things a
> lot simpler.

Thanks for the explanations Ioi!

David
-----

> Thanks
> - Ioi
>
>> -------------
>>
>> PR: https://git.openjdk.java.net/jdk/pull/3203
>