[GitHub] commons-lang issue #231: Evaluate Architecure
Github user Tomschi commented on the issue: https://github.com/apache/commons-lang/pull/231 I'm not sure, if we really need the isXXX methods in the Processor class, because i can directly equal the enums. --- 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. ---
[GitHub] commons-lang issue #231: Evaluate Architecure
Github user Tomschi commented on the issue: https://github.com/apache/commons-lang/pull/231 > There's no point in having the isXXX() methods any more. There just need to be methods to get the Processor. If necessary, the Processor class could have isxxx methods on it. This methods are for me an easy and null safe way for evaluating. Further, this methods are the reason, why i have done this pull request. --- 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. ---
[GitHub] commons-lang issue #231: Evaluate Architecure
Github user Tomschi commented on the issue: https://github.com/apache/commons-lang/pull/231 > If there is no database entry, return a Process instance with enums which indicate "Unknown". (Attribute enums would need an extra 'Unknown' entry). I think it is better to return null, if the Processor doesn't exists. I added UNKNOWN to both enums, but UNKNOWN can also be used for a existing Processor. So it is hard to evaluate, if the Processor exists or not, when the properties UNKNOWN are used. --- 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. ---
[GitHub] commons-lang pull request #231: Evaluate Architecure
Github user Tomschi commented on a diff in the pull request: https://github.com/apache/commons-lang/pull/231#discussion_r105353803 --- Diff: src/main/java/org/apache/commons/lang3/arch/Processor.java --- @@ -0,0 +1,30 @@ +package org.apache.commons.lang3.arch; + +/** + * + */ +public class Processor { + +private String name; +private ProcessorArch processorArch; +private ProcessorType processorType; + --- End diff -- I think the name field is needed for better reuse of the Processor object. --- 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. ---
[GitHub] commons-lang issue #231: Evaluate Architecure
Github user Tomschi commented on the issue: https://github.com/apache/commons-lang/pull/231 I have created a new class ArchUtilsImproved. @sebbASF This approach is more extendable. Is this implementation better for you? --- 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. ---
[GitHub] commons-lang pull request #231: Evaluate Architecure
Github user Tomschi commented on a diff in the pull request: https://github.com/apache/commons-lang/pull/231#discussion_r105117588 --- 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. + * + * + * Important: The os.arch System Property returns the architecture used by the JVM + * not of the operating system. + * + * + * @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 -- It is for me ok, to remove the methods to adding own architectures. I only want to give the possibility to add missing architecture, when needed. Should i remove this methods now? --- 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. ---
[GitHub] commons-lang issue #231: Evaluate Architecure
Github user Tomschi commented on the issue: https://github.com/apache/commons-lang/pull/231 I changed the HashMap to a ConcurrentHashMap. --- 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. ---
[GitHub] commons-lang issue #231: Evaluate Architecure
Github user Tomschi commented on the issue: https://github.com/apache/commons-lang/pull/231 I'm sorry. I removed the tabs. Style should be ok now. --- 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. ---
[GitHub] commons-lang issue #231: Evaluate Architecure
Github user Tomschi commented on the issue: https://github.com/apache/commons-lang/pull/231 Yes, the base of my code references to the commons crypto lib. --- 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. ---
[GitHub] commons-lang issue #231: Evaluate Architecure
Github user Tomschi commented on the issue: https://github.com/apache/commons-lang/pull/231 It's ok for me, i will change it. --- 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. ---
[GitHub] commons-lang issue #231: Evaluate Architecure
Github user Tomschi commented on the issue: https://github.com/apache/commons-lang/pull/231 I'am using it for the jacob-project. There i have to know, if it is a 32 or 64 bit architecture to load the correct dll library. --- 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. ---
[GitHub] commons-lang issue #231: Evaluate Architecure
Github user Tomschi commented on the issue: https://github.com/apache/commons-lang/pull/231 Rewrite javadoc's. --- 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. ---
[GitHub] commons-lang pull request #231: Evaluate Architecure
GitHub user Tomschi opened a pull request: https://github.com/apache/commons-lang/pull/231 Evaluate Architecure Add static field for hardware architecure. You can merge this pull request into a Git repository by running: $ git pull https://github.com/Tomschi/commons-lang master Alternatively you can review and apply these changes as the patch at: https://github.com/apache/commons-lang/pull/231.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #231 commit 13df6b084b0ac64e291d10f7ecdb4dc85e7cde91 Author: Tomschi <toms...@users.noreply.github.com> Date: 2017-02-02T20:29:39Z Add boolean variables for evaluating architecture. --- 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. ---