Github user kinow commented on a diff in the pull request:

    https://github.com/apache/commons-lang/pull/231#discussion_r105107484
  
    --- Diff: src/main/java/org/apache/commons/lang3/ArchUtils.java ---
    @@ -0,0 +1,446 @@
    +/*
    + * 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.commons.lang3;
    +
    +import java.util.Map;
    +import java.util.concurrent.ConcurrentHashMap;
    +
    +/**
    + * An utility class for the os.arch System Property. The class defines 
methods for
    + * identifying the architecture of the current JVM.
    + * <p>
    + * <p>
    + * Important: The os.arch System Property returns the architecture used by 
the JVM
    + * not of the operating system.
    + * </p>
    + *
    + * @author Tomschi
    + */
    +public class ArchUtils {
    +
    +    /**
    +     * This {@link Map} contains the the possible os.arch property {@link 
String}'s.
    +     */
    +    private static final Map<String, String> map;
    +
    +    /**
    +     * The value for x86 architecture.
    +     */
    +    private static final String X86 = "x86";
    +
    +    /**
    +     * The value for x86_64 architecture.
    +     */
    +    private static final String X86_64 = "x86_64";
    +
    +    /**
    +     * The value for ia64_32 architecture.
    +     */
    +    private static final String IA64_32 = "ia64_32";
    +
    +    /**
    +     * The value for ia64 architecture.
    +     */
    +    private static final String IA64 = "ia64";
    +
    +    /**
    +     * The value for ppc architecture.
    +     */
    +    private static final String PPC = "ppc";
    +
    +    /**
    +     * The value for ppc64 architecture.
    +     */
    +    private static final String PPC64 = "ppc64";
    +
    +    static {
    +        map = new ConcurrentHashMap<>();
    --- End diff --
    
    Much better, from a concurrency point of view :-)
    
    Now my preference would be do not allow the user to change it. Otherwise 
you could accidentally remove one arch, or overwrite it. Besides that, I don't 
see why we need to let users change that.
    
    If there is an architecture that is not supported, I think it would be 
better that users will apply a temporary patch to their code and/or report an 
issue. Then we will update the list of architectures.
    
    Maybe we could include it as in [crypto] @Tomschi , as a read-only 
structure for now, and then later discuss about exposing methods to manipulate 
the map. What do you think? 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to