uschindler commented on code in PR #13196: URL: https://github.com/apache/lucene/pull/13196#discussion_r1535274772
########## lucene/core/src/java21/org/apache/lucene/store/PosixNativeAccess.java: ########## @@ -0,0 +1,82 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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. + */ +package org.apache.lucene.store; + +import java.io.IOException; +import java.lang.foreign.FunctionDescriptor; +import java.lang.foreign.Linker; +import java.lang.foreign.MemorySegment; +import java.lang.foreign.SymbolLookup; +import java.lang.foreign.ValueLayout; +import java.lang.invoke.MethodHandle; +import java.util.Locale; +import java.util.logging.Logger; + +@SuppressWarnings("preview") +final class PosixNativeAccess extends NativeAccess { + + private static final Logger LOG = Logger.getLogger(PosixNativeAccess.class.getName()); + + private final MethodHandle mh$posix_madvise; Review Comment: Thanks. You're not angry to revert it for now and make a second try? I think to have those static we need a different way to report back to the caller of getInstance or the constructor that the necessary symbols are not available or the lookup failed because the module has no access to native functions. All this is no longer handled and we may cause problems because reporting the exceptions is only depending on class loading order. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org