Skip to content

Commit

Permalink
Updates to native image configuration to support latest release of Gr…
Browse files Browse the repository at this point in the history
…aalVM. (#8838)
  • Loading branch information
tomas-langer committed Jun 7, 2024
1 parent 97bcf73 commit 1f0195e
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#
# Copyright (c) 2024 Oracle and/or its affiliates.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

Args=--initialize-at-build-time=io.helidon.common.configurable.LruCache \
--initialize-at-build-time=io.helidon.common.configurable.LruCacheConfig
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2019, 2023 Oracle and/or its affiliates.
# Copyright (c) 2019, 2024 Oracle and/or its affiliates.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -40,7 +40,12 @@ Args=--features=io.helidon.integrations.graal.mp.nativeimage.extension.HelidonMp
--initialize-at-build-time=jakarta.interceptor \
--initialize-at-build-time=jakarta.annotation \
--initialize-at-build-time=com.sun.beans.TypeResolver \
--initialize-at-build-time=com.sun.beans.WeakCache \
--initialize-at-build-time=java.beans.PropertyDescriptor \
--initialize-at-build-time=java.beans.MethodRef \
--initialize-at-build-time=org.yaml.snakeyaml \
--initialize-at-build-time=org.jvnet.hk2 \
--initialize-at-build-time=java.lang.annotation.Annotation \
--initialize-at-build-time=io.helidon \
--initialize-at-build-time=org.eclipse.microprofile \
--report-unsupported-elements-at-runtime
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#
# Copyright (c) 2024 Oracle and/or its affiliates.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

Args=--initialize-at-build-time=io.helidon.logging.jul.JulMdcPropagator
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
import java.util.stream.Collectors;

import io.helidon.common.Errors;
import io.helidon.common.LazyValue;
import io.helidon.common.parameters.Parameters;
import io.helidon.http.HeaderNames;
import io.helidon.http.HeaderValues;
Expand Down Expand Up @@ -83,7 +84,7 @@ class TenantAuthenticationHandler {
private static final System.Logger LOGGER = System.getLogger(TenantAuthenticationHandler.class.getName());
private static final TokenHandler PARAM_HEADER_HANDLER = TokenHandler.forHeader(OidcConfig.PARAM_HEADER_NAME);
private static final TokenHandler PARAM_ID_HEADER_HANDLER = TokenHandler.forHeader(OidcConfig.PARAM_ID_HEADER_NAME);
private static final SecureRandom RANDOM = new SecureRandom();
private static final LazyValue<SecureRandom> RANDOM = LazyValue.create(SecureRandom::new);

private final boolean optional;
private final OidcConfig oidcConfig;
Expand Down Expand Up @@ -824,7 +825,7 @@ private static String generateRandomString() {
int rightLimit = 122; // letter 'z'
int targetStringLength = 10;

return RANDOM.ints(leftLimit, rightLimit + 1)
return RANDOM.get().ints(leftLimit, rightLimit + 1)
.filter(i -> (i <= 57 || i >= 65) && (i <= 90 || i >= 97))
.limit(targetStringLength)
.collect(StringBuilder::new, StringBuilder::appendCodePoint, StringBuilder::append)
Expand Down

0 comments on commit 1f0195e

Please sign in to comment.