[jira] [Commented] (LANG-1300) Clarify or improve behaviour of int-based methods in StringUtils

2017-03-09 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/LANG-1300?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15904594#comment-15904594
 ] 

ASF GitHub Bot commented on LANG-1300:
--

Github user dmjones500 commented on the issue:

https://github.com/apache/commons-lang/pull/251
  
We need to agree on the desired behaviour of the method. Based on the 
signature, I think we can adjust it to support supplementary characters without 
violating the implied contract of the method. The issue for me is about indexes.

Based on the JavaDoc description, I suggest we return the code unit index. 
This is because the input is a `CharSequence` and the JavaDoc states:

> Finds the first index within a `CharSequence`, handling null.

Also, a `CharSequence` only has methods which operate on code unit indexes. 
So returning a code unit index would be helpful for further operations on the 
sequence.

What does everyone else think? We should obviously update the JavaDocs to 
make it crystal clear what we decide, either way.


> Clarify or improve behaviour of int-based methods in StringUtils
> 
>
> Key: LANG-1300
> URL: https://issues.apache.org/jira/browse/LANG-1300
> Project: Commons Lang
>  Issue Type: Improvement
>  Components: lang.*
>Affects Versions: 3.5
>Reporter: Duncan Jones
>Priority: Minor
> Fix For: Discussion
>
>
> The following methods use an {{int}} to represent a search character:
> {code:java}
> boolean contains(final CharSequence seq, final int searchChar)
> int indexOf(final CharSequence seq, final int searchChar)
> int indexOf(final CharSequence seq, final int searchChar, final int startPos)
> int lastIndexOf(final CharSequence seq, final int searchChar)
> int lastIndexOf(final CharSequence seq, final int searchChar, final int 
> startPos)
> {code}
> When I see an {{int}} representing a character, I tend to assume the method 
> can handle supplementary characters. However, the current behaviour of these 
> methods depends upon whether the {{CharSequence}} is a {{String}} or not.
> {code:java}
> StringBuilder builder = new StringBuilder();
> builder.appendCodePoint(0x2070E);
> System.out.println(StringUtils.lastIndexOf(builder, 0x2070E)); // -1
> System.out.println(StringUtils.lastIndexOf(builder.toString(), 0x2070E)); // 0
> {code}
> The Javadoc for these methods are ambiguous on this point, stating:
> {quote}
> This method uses {{String.lastIndexOf(int)}} if possible.
> {quote}
> I think we should consider updating the {{CharSequenceUtils}} methods used by 
> this class to convert all {{CharSequence}} parameters to strings, enabling 
> full code point support. The docs could be updated to make this crystal clear.
> There is a question of whether this breaks backwards compatibility.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[GitHub] commons-lang issue #251: LANG-1300: Change CharSequenceUtils to support supp...

2017-03-09 Thread dmjones500
Github user dmjones500 commented on the issue:

https://github.com/apache/commons-lang/pull/251
  
We need to agree on the desired behaviour of the method. Based on the 
signature, I think we can adjust it to support supplementary characters without 
violating the implied contract of the method. The issue for me is about indexes.

Based on the JavaDoc description, I suggest we return the code unit index. 
This is because the input is a `CharSequence` and the JavaDoc states:

> Finds the first index within a `CharSequence`, handling null.

Also, a `CharSequence` only has methods which operate on code unit indexes. 
So returning a code unit index would be helpful for further operations on the 
sequence.

What does everyone else think? We should obviously update the JavaDocs to 
make it crystal clear what we decide, either way.


---
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.
---


[jira] [Updated] (NET-623) SubnetUtils - fixed spelling errors

2017-03-09 Thread Makoto Sakaguchi (JIRA)

 [ 
https://issues.apache.org/jira/browse/NET-623?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Makoto Sakaguchi updated NET-623:
-
Description: 
Fixed spelling errors in the API document.
https://github.com/apache/commons-net/pull/14

  was:
Fixed spelling errors in the API document.
line 70: the hostcount -> the host count
line 115: adresses ->  addresses


> SubnetUtils - fixed spelling errors
> ---
>
> Key: NET-623
> URL: https://issues.apache.org/jira/browse/NET-623
> Project: Commons Net
>  Issue Type: Improvement
>Reporter: Makoto Sakaguchi
>
> Fixed spelling errors in the API document.
> https://github.com/apache/commons-net/pull/14



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Updated] (NET-624) SubnetInfo#toCidrNotation - a wrong format subnet mask is allows

2017-03-09 Thread Makoto Sakaguchi (JIRA)

 [ 
https://issues.apache.org/jira/browse/NET-624?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Makoto Sakaguchi updated NET-624:
-
Description: 
An IPv4 subnet mask, which is also the network mask, must consist of a set of 
contiguous 1-bits followed by a block of 0-bits (i.e. 255.255.255.0), but it 
does not check.

{code}
/* 255.255.0.1 is ...0001 in  binary */
SubnetUtils su = new SubnetUtils("192.168.0.1", "255.255.0.1"); // expect error
SubnetInfo si = su.getInfo();
System.out.println(si.getNetmask()); // Expect error or 255.255.0.1
255.255.128.0
{code}

https://github.com/apache/commons-net/pull/13

  was:
An IPv4 subnet mask, which is also the network mask, must consist of a set of 
contiguous 1-bits followed by a block of 0-bits (i.e. 255.255.255.0), but it 
does not check.

{code}
/* 255.255.0.1 is ...0001 in  binary */
SubnetUtils su = new SubnetUtils("192.168.0.1", "255.255.0.1"); // expect error
SubnetInfo si = su.getInfo();
System.out.println(si.getNetmask()); // Expect error or 255.255.0.1
255.255.128.0
{code}

https://github.com/apache/commons-net/pull/12


> SubnetInfo#toCidrNotation - a wrong format subnet mask is allows
> 
>
> Key: NET-624
> URL: https://issues.apache.org/jira/browse/NET-624
> Project: Commons Net
>  Issue Type: Bug
>Affects Versions: 2.0
>Reporter: Makoto Sakaguchi
>
> An IPv4 subnet mask, which is also the network mask, must consist of a set of 
> contiguous 1-bits followed by a block of 0-bits (i.e. 255.255.255.0), but it 
> does not check.
> {code}
> /* 255.255.0.1 is ...0001 in  binary */
> SubnetUtils su = new SubnetUtils("192.168.0.1", "255.255.0.1"); // expect 
> error
> SubnetInfo si = su.getInfo();
> System.out.println(si.getNetmask()); // Expect error or 255.255.0.1
> 255.255.128.0
> {code}
> https://github.com/apache/commons-net/pull/13



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Updated] (NET-624) SubnetInfo#toCidrNotation - a wrong format subnet mask is allows

2017-03-09 Thread Makoto Sakaguchi (JIRA)

 [ 
https://issues.apache.org/jira/browse/NET-624?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Makoto Sakaguchi updated NET-624:
-
Flags: Patch

> SubnetInfo#toCidrNotation - a wrong format subnet mask is allows
> 
>
> Key: NET-624
> URL: https://issues.apache.org/jira/browse/NET-624
> Project: Commons Net
>  Issue Type: Bug
>Affects Versions: 2.0
>Reporter: Makoto Sakaguchi
>
> An IPv4 subnet mask, which is also the network mask, must consist of a set of 
> contiguous 1-bits followed by a block of 0-bits (i.e. 255.255.255.0), but it 
> does not check.
> {code}
> /* 255.255.0.1 is ...0001 in  binary */
> SubnetUtils su = new SubnetUtils("192.168.0.1", "255.255.0.1"); // expect 
> error
> SubnetInfo si = su.getInfo();
> System.out.println(si.getNetmask()); // Expect error or 255.255.0.1
> 255.255.128.0
> {code}
> https://github.com/apache/commons-net/pull/12



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Updated] (NET-624) SubnetInfo#toCidrNotation - a wrong format subnet mask is allows

2017-03-09 Thread Makoto Sakaguchi (JIRA)

 [ 
https://issues.apache.org/jira/browse/NET-624?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Makoto Sakaguchi updated NET-624:
-
Flags:   (was: Patch)

> SubnetInfo#toCidrNotation - a wrong format subnet mask is allows
> 
>
> Key: NET-624
> URL: https://issues.apache.org/jira/browse/NET-624
> Project: Commons Net
>  Issue Type: Bug
>Affects Versions: 2.0
>Reporter: Makoto Sakaguchi
>
> An IPv4 subnet mask, which is also the network mask, must consist of a set of 
> contiguous 1-bits followed by a block of 0-bits (i.e. 255.255.255.0), but it 
> does not check.
> {code}
> /* 255.255.0.1 is ...0001 in  binary */
> SubnetUtils su = new SubnetUtils("192.168.0.1", "255.255.0.1"); // expect 
> error
> SubnetInfo si = su.getInfo();
> System.out.println(si.getNetmask()); // Expect error or 255.255.0.1
> 255.255.128.0
> {code}
> https://github.com/apache/commons-net/pull/12



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Updated] (NET-624) SubnetInfo#toCidrNotation - a wrong format subnet mask is allows

2017-03-09 Thread Makoto Sakaguchi (JIRA)

 [ 
https://issues.apache.org/jira/browse/NET-624?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Makoto Sakaguchi updated NET-624:
-
Description: 
An IPv4 subnet mask, which is also the network mask, must consist of a set of 
contiguous 1-bits followed by a block of 0-bits (i.e. 255.255.255.0), but it 
does not check.

{code}
/* 255.255.0.1 is ...0001 in  binary */
SubnetUtils su = new SubnetUtils("192.168.0.1", "255.255.0.1"); // expect error
SubnetInfo si = su.getInfo();
System.out.println(si.getNetmask()); // Expect error or 255.255.0.1
255.255.128.0
{code}

https://github.com/apache/commons-net/pull/12

  was:
An IPv4 subnet mask, which is also the network mask, must consist of a set of 
contiguous 1-bits followed by a block of 0-bits (i.e. 255.255.255.0), but it 
does not check.

{code}
/* 255.255.0.1 is ...0001 in  binary */
SubnetUtils su = new SubnetUtils("192.168.0.1", "255.255.0.1"); // expect error
SubnetInfo si = su.getInfo();
System.out.println(si.getNetmask()); // Expect error or 255.255.0.1
255.255.128.0
{code}


> SubnetInfo#toCidrNotation - a wrong format subnet mask is allows
> 
>
> Key: NET-624
> URL: https://issues.apache.org/jira/browse/NET-624
> Project: Commons Net
>  Issue Type: Bug
>Affects Versions: 2.0
>Reporter: Makoto Sakaguchi
>
> An IPv4 subnet mask, which is also the network mask, must consist of a set of 
> contiguous 1-bits followed by a block of 0-bits (i.e. 255.255.255.0), but it 
> does not check.
> {code}
> /* 255.255.0.1 is ...0001 in  binary */
> SubnetUtils su = new SubnetUtils("192.168.0.1", "255.255.0.1"); // expect 
> error
> SubnetInfo si = su.getInfo();
> System.out.println(si.getNetmask()); // Expect error or 255.255.0.1
> 255.255.128.0
> {code}
> https://github.com/apache/commons-net/pull/12



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Updated] (NET-624) SubnetInfo#toCidrNotation - a wrong format subnet mask is allows

2017-03-09 Thread Makoto Sakaguchi (JIRA)

 [ 
https://issues.apache.org/jira/browse/NET-624?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Makoto Sakaguchi updated NET-624:
-
Summary: SubnetInfo#toCidrNotation - a wrong format subnet mask is allows  
(was: SubnetInfo#toCidrNotation: a wrong format subnet mask is allows)

> SubnetInfo#toCidrNotation - a wrong format subnet mask is allows
> 
>
> Key: NET-624
> URL: https://issues.apache.org/jira/browse/NET-624
> Project: Commons Net
>  Issue Type: Bug
>Affects Versions: 2.0
>Reporter: Makoto Sakaguchi
>
> An IPv4 subnet mask, which is also the network mask, must consist of a set of 
> contiguous 1-bits followed by a block of 0-bits (i.e. 255.255.255.0), but it 
> does not check.
> {code}
> /* 255.255.0.1 is ...0001 in  binary */
> SubnetUtils su = new SubnetUtils("192.168.0.1", "255.255.0.1"); // expect 
> error
> SubnetInfo si = su.getInfo();
> System.out.println(si.getNetmask()); // Expect error or 255.255.0.1
> 255.255.128.0
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Updated] (NET-624) SubnetInfo#toCidrNotation: A wrong format subnet mask is allows.

2017-03-09 Thread Makoto Sakaguchi (JIRA)

 [ 
https://issues.apache.org/jira/browse/NET-624?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Makoto Sakaguchi updated NET-624:
-
Summary: SubnetInfo#toCidrNotation: A wrong format subnet mask is allows.  
(was: SubnetInfo#toCidrNotation - allow a subnet mask)

> SubnetInfo#toCidrNotation: A wrong format subnet mask is allows.
> 
>
> Key: NET-624
> URL: https://issues.apache.org/jira/browse/NET-624
> Project: Commons Net
>  Issue Type: Bug
>Affects Versions: 2.0
>Reporter: Makoto Sakaguchi
>
> An IPv4 subnet mask, which is also the network mask, must consist of a set of 
> contiguous 1-bits followed by a block of 0-bits (i.e. 255.255.255.0), but it 
> does not check.
> {code}
> /* 255.255.0.1 is ...0001 in  binary */
> SubnetUtils su = new SubnetUtils("192.168.0.1", "255.255.0.1"); // expect 
> error
> SubnetInfo si = su.getInfo();
> System.out.println(si.getNetmask()); // Expect error or 255.255.0.1
> 255.255.128.0
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Updated] (NET-624) SubnetInfo#toCidrNotation: a wrong format subnet mask is allows

2017-03-09 Thread Makoto Sakaguchi (JIRA)

 [ 
https://issues.apache.org/jira/browse/NET-624?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Makoto Sakaguchi updated NET-624:
-
Summary: SubnetInfo#toCidrNotation: a wrong format subnet mask is allows  
(was: SubnetInfo#toCidrNotation: A wrong format subnet mask is allows)

> SubnetInfo#toCidrNotation: a wrong format subnet mask is allows
> ---
>
> Key: NET-624
> URL: https://issues.apache.org/jira/browse/NET-624
> Project: Commons Net
>  Issue Type: Bug
>Affects Versions: 2.0
>Reporter: Makoto Sakaguchi
>
> An IPv4 subnet mask, which is also the network mask, must consist of a set of 
> contiguous 1-bits followed by a block of 0-bits (i.e. 255.255.255.0), but it 
> does not check.
> {code}
> /* 255.255.0.1 is ...0001 in  binary */
> SubnetUtils su = new SubnetUtils("192.168.0.1", "255.255.0.1"); // expect 
> error
> SubnetInfo si = su.getInfo();
> System.out.println(si.getNetmask()); // Expect error or 255.255.0.1
> 255.255.128.0
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Updated] (NET-624) SubnetInfo#toCidrNotation: A wrong format subnet mask is allows

2017-03-09 Thread Makoto Sakaguchi (JIRA)

 [ 
https://issues.apache.org/jira/browse/NET-624?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Makoto Sakaguchi updated NET-624:
-
Summary: SubnetInfo#toCidrNotation: A wrong format subnet mask is allows  
(was: SubnetInfo#toCidrNotation: A wrong format subnet mask is allows.)

> SubnetInfo#toCidrNotation: A wrong format subnet mask is allows
> ---
>
> Key: NET-624
> URL: https://issues.apache.org/jira/browse/NET-624
> Project: Commons Net
>  Issue Type: Bug
>Affects Versions: 2.0
>Reporter: Makoto Sakaguchi
>
> An IPv4 subnet mask, which is also the network mask, must consist of a set of 
> contiguous 1-bits followed by a block of 0-bits (i.e. 255.255.255.0), but it 
> does not check.
> {code}
> /* 255.255.0.1 is ...0001 in  binary */
> SubnetUtils su = new SubnetUtils("192.168.0.1", "255.255.0.1"); // expect 
> error
> SubnetInfo si = su.getInfo();
> System.out.println(si.getNetmask()); // Expect error or 255.255.0.1
> 255.255.128.0
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (IMAGING-199) All tEXt chunks are not returned from PngImageParser.getMetadata

2017-03-09 Thread Ric Emery (JIRA)

[ 
https://issues.apache.org/jira/browse/IMAGING-199?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15904115#comment-15904115
 ] 

Ric Emery commented on IMAGING-199:
---

Submitted pull request in GitHub - 
https://github.com/apache/commons-imaging/pull/25 .

> All tEXt chunks are not returned from PngImageParser.getMetadata
> 
>
> Key: IMAGING-199
> URL: https://issues.apache.org/jira/browse/IMAGING-199
> Project: Commons Imaging
>  Issue Type: Bug
>  Components: Format: PNG
>Reporter: Ric Emery
>Priority: Minor
>  Labels: newbie
>
> According to the PNG spec - Section 4.2.3 - Textual Information -
> "Any number of text chunks can appear, and more than one with the same 
> keyword is permissible. "
> Unfortunately the PngImageParser.getMetadata method only supports a single 
> tEXt chunk.  The problem is in the following line:
> final List chunks = readChunks(byteSource, new ChunkType[] 
> { ChunkType.tEXt, ChunkType.zTXt, }, true);
> True is being passed for returnAfterFirst. I believe that false should be 
> passed instead.
> I can submit a pull request if you agree.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[GitHub] commons-lang pull request #253: Added a restart method for convenience

2017-03-09 Thread esend7881
GitHub user esend7881 opened a pull request:

https://github.com/apache/commons-lang/pull/253

Added a restart method for convenience

The restart function will allow lazy people like me to simple call 
`stopwatch.reset()` instead of manually calling the `stop`, `restart` `start` 
methods one by one, or recreating the object itself.

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/esend7881/commons-lang master

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/commons-lang/pull/253.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 #253


commit d6f3109985eec112acb1584d3561c04ca9a76b9b
Author: Eric K. Sender 
Date:   2017-03-09T21:53:44Z

Added a restart method for convenience 

The restart function will allow lazy people like me to simple call 
`stopwatch.reset()` instead of manually calling the `stop`, `restart` `start` 
methods one by one, or recreating the object itself.




---
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.
---


[jira] [Updated] (NET-624) SubnetInfo#toCidrNotation - allow a subnet mask

2017-03-09 Thread Makoto Sakaguchi (JIRA)

 [ 
https://issues.apache.org/jira/browse/NET-624?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Makoto Sakaguchi updated NET-624:
-
Description: 
An IPv4 subnet mask, which is also the network mask, must consist of a set of 
contiguous 1-bits followed by a block of 0-bits (i.e. 255.255.255.0), but it 
does not check.

{code}
/* 255.255.0.1 is ...0001 in  binary */
SubnetUtils su = new SubnetUtils("192.168.0.1", "255.255.0.1"); // expect error
SubnetInfo si = su.getInfo();
System.out.println(si.getNetmask()); // Expect error or 255.255.0.1
255.255.128.0
{code}

  was:
An IPv4 subnet mask, which is also the network mask, must consist of a set of 
contiguous 1-bits followed by a block of 0-bits (i.e. 255.255.255.0), but it 
does not check.

{code}
/* 255.255.0.1 is ...0001 in  binary */
SubnetUtils su = new Subnet("192.168.0.1", "255.255.0.1"); // expect error
SubnetInfo si = su.getInfo();
System.out.println(si.getNetmask()); // Expect error or 255.255.0.1
255.255.128.0
{code}


> SubnetInfo#toCidrNotation - allow a subnet mask
> ---
>
> Key: NET-624
> URL: https://issues.apache.org/jira/browse/NET-624
> Project: Commons Net
>  Issue Type: Bug
>Affects Versions: 2.0
>Reporter: Makoto Sakaguchi
>
> An IPv4 subnet mask, which is also the network mask, must consist of a set of 
> contiguous 1-bits followed by a block of 0-bits (i.e. 255.255.255.0), but it 
> does not check.
> {code}
> /* 255.255.0.1 is ...0001 in  binary */
> SubnetUtils su = new SubnetUtils("192.168.0.1", "255.255.0.1"); // expect 
> error
> SubnetInfo si = su.getInfo();
> System.out.println(si.getNetmask()); // Expect error or 255.255.0.1
> 255.255.128.0
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Created] (NET-624) SubnetInfo#toCidrNotation - allow a subnet mask

2017-03-09 Thread Makoto Sakaguchi (JIRA)
Makoto Sakaguchi created NET-624:


 Summary: SubnetInfo#toCidrNotation - allow a subnet mask
 Key: NET-624
 URL: https://issues.apache.org/jira/browse/NET-624
 Project: Commons Net
  Issue Type: Bug
Affects Versions: 2.0
Reporter: Makoto Sakaguchi


An IPv4 subnet mask, which is also the network mask, must consist of a set of 
contiguous 1-bits followed by a block of 0-bits (i.e. 255.255.255.0), but it 
does not check.

{code}
/* 255.255.0.1 is ...0001 in  binary */
SubnetUtils su = new Subnet("192.168.0.1", "255.255.0.1"); // expect error
SubnetInfo si = su.getInfo();
System.out.println(si.getNetmask()); // Expect error or 255.255.0.1
255.255.128.0
{code}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (LANG-1300) Clarify or improve behaviour of int-based methods in StringUtils

2017-03-09 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/LANG-1300?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15903350#comment-15903350
 ] 

ASF GitHub Bot commented on LANG-1300:
--

Github user coveralls commented on the issue:

https://github.com/apache/commons-lang/pull/251
  

[![Coverage 
Status](https://coveralls.io/builds/10513391/badge)](https://coveralls.io/builds/10513391)

Coverage increased (+0.04%) to 94.576% when pulling 
**b45435c950e6f6864671bdffde29e26cdc8ce15b on 
MarkDacek:Lang1300CharSequenceUtilsChange** into 
**6597c196521af500feef7a02610727eafa7ec1dc on apache:master**.



> Clarify or improve behaviour of int-based methods in StringUtils
> 
>
> Key: LANG-1300
> URL: https://issues.apache.org/jira/browse/LANG-1300
> Project: Commons Lang
>  Issue Type: Improvement
>  Components: lang.*
>Affects Versions: 3.5
>Reporter: Duncan Jones
>Priority: Minor
> Fix For: Discussion
>
>
> The following methods use an {{int}} to represent a search character:
> {code:java}
> boolean contains(final CharSequence seq, final int searchChar)
> int indexOf(final CharSequence seq, final int searchChar)
> int indexOf(final CharSequence seq, final int searchChar, final int startPos)
> int lastIndexOf(final CharSequence seq, final int searchChar)
> int lastIndexOf(final CharSequence seq, final int searchChar, final int 
> startPos)
> {code}
> When I see an {{int}} representing a character, I tend to assume the method 
> can handle supplementary characters. However, the current behaviour of these 
> methods depends upon whether the {{CharSequence}} is a {{String}} or not.
> {code:java}
> StringBuilder builder = new StringBuilder();
> builder.appendCodePoint(0x2070E);
> System.out.println(StringUtils.lastIndexOf(builder, 0x2070E)); // -1
> System.out.println(StringUtils.lastIndexOf(builder.toString(), 0x2070E)); // 0
> {code}
> The Javadoc for these methods are ambiguous on this point, stating:
> {quote}
> This method uses {{String.lastIndexOf(int)}} if possible.
> {quote}
> I think we should consider updating the {{CharSequenceUtils}} methods used by 
> this class to convert all {{CharSequence}} parameters to strings, enabling 
> full code point support. The docs could be updated to make this crystal clear.
> There is a question of whether this breaks backwards compatibility.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[GitHub] commons-lang issue #251: LANG-1300: Change CharSequenceUtils to support supp...

2017-03-09 Thread coveralls
Github user coveralls commented on the issue:

https://github.com/apache/commons-lang/pull/251
  

[![Coverage 
Status](https://coveralls.io/builds/10513391/badge)](https://coveralls.io/builds/10513391)

Coverage increased (+0.04%) to 94.576% when pulling 
**b45435c950e6f6864671bdffde29e26cdc8ce15b on 
MarkDacek:Lang1300CharSequenceUtilsChange** into 
**6597c196521af500feef7a02610727eafa7ec1dc on apache:master**.



---
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 #251: LANG-1300: Change CharSequenceUtils to support supp...

2017-03-09 Thread coveralls
Github user coveralls commented on the issue:

https://github.com/apache/commons-lang/pull/251
  

[![Coverage 
Status](https://coveralls.io/builds/10513306/badge)](https://coveralls.io/builds/10513306)

Coverage increased (+0.004%) to 94.54% when pulling 
**b45435c950e6f6864671bdffde29e26cdc8ce15b on 
MarkDacek:Lang1300CharSequenceUtilsChange** into 
**6597c196521af500feef7a02610727eafa7ec1dc on apache:master**.



---
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.
---


[jira] [Commented] (LANG-1300) Clarify or improve behaviour of int-based methods in StringUtils

2017-03-09 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/LANG-1300?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15903340#comment-15903340
 ] 

ASF GitHub Bot commented on LANG-1300:
--

Github user coveralls commented on the issue:

https://github.com/apache/commons-lang/pull/251
  

[![Coverage 
Status](https://coveralls.io/builds/10513306/badge)](https://coveralls.io/builds/10513306)

Coverage increased (+0.004%) to 94.54% when pulling 
**b45435c950e6f6864671bdffde29e26cdc8ce15b on 
MarkDacek:Lang1300CharSequenceUtilsChange** into 
**6597c196521af500feef7a02610727eafa7ec1dc on apache:master**.



> Clarify or improve behaviour of int-based methods in StringUtils
> 
>
> Key: LANG-1300
> URL: https://issues.apache.org/jira/browse/LANG-1300
> Project: Commons Lang
>  Issue Type: Improvement
>  Components: lang.*
>Affects Versions: 3.5
>Reporter: Duncan Jones
>Priority: Minor
> Fix For: Discussion
>
>
> The following methods use an {{int}} to represent a search character:
> {code:java}
> boolean contains(final CharSequence seq, final int searchChar)
> int indexOf(final CharSequence seq, final int searchChar)
> int indexOf(final CharSequence seq, final int searchChar, final int startPos)
> int lastIndexOf(final CharSequence seq, final int searchChar)
> int lastIndexOf(final CharSequence seq, final int searchChar, final int 
> startPos)
> {code}
> When I see an {{int}} representing a character, I tend to assume the method 
> can handle supplementary characters. However, the current behaviour of these 
> methods depends upon whether the {{CharSequence}} is a {{String}} or not.
> {code:java}
> StringBuilder builder = new StringBuilder();
> builder.appendCodePoint(0x2070E);
> System.out.println(StringUtils.lastIndexOf(builder, 0x2070E)); // -1
> System.out.println(StringUtils.lastIndexOf(builder.toString(), 0x2070E)); // 0
> {code}
> The Javadoc for these methods are ambiguous on this point, stating:
> {quote}
> This method uses {{String.lastIndexOf(int)}} if possible.
> {quote}
> I think we should consider updating the {{CharSequenceUtils}} methods used by 
> this class to convert all {{CharSequence}} parameters to strings, enabling 
> full code point support. The docs could be updated to make this crystal clear.
> There is a question of whether this breaks backwards compatibility.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (LANG-1300) Clarify or improve behaviour of int-based methods in StringUtils

2017-03-09 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/LANG-1300?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15903341#comment-15903341
 ] 

ASF GitHub Bot commented on LANG-1300:
--

Github user coveralls commented on the issue:

https://github.com/apache/commons-lang/pull/251
  

[![Coverage 
Status](https://coveralls.io/builds/10513306/badge)](https://coveralls.io/builds/10513306)

Coverage increased (+0.004%) to 94.54% when pulling 
**b45435c950e6f6864671bdffde29e26cdc8ce15b on 
MarkDacek:Lang1300CharSequenceUtilsChange** into 
**6597c196521af500feef7a02610727eafa7ec1dc on apache:master**.



> Clarify or improve behaviour of int-based methods in StringUtils
> 
>
> Key: LANG-1300
> URL: https://issues.apache.org/jira/browse/LANG-1300
> Project: Commons Lang
>  Issue Type: Improvement
>  Components: lang.*
>Affects Versions: 3.5
>Reporter: Duncan Jones
>Priority: Minor
> Fix For: Discussion
>
>
> The following methods use an {{int}} to represent a search character:
> {code:java}
> boolean contains(final CharSequence seq, final int searchChar)
> int indexOf(final CharSequence seq, final int searchChar)
> int indexOf(final CharSequence seq, final int searchChar, final int startPos)
> int lastIndexOf(final CharSequence seq, final int searchChar)
> int lastIndexOf(final CharSequence seq, final int searchChar, final int 
> startPos)
> {code}
> When I see an {{int}} representing a character, I tend to assume the method 
> can handle supplementary characters. However, the current behaviour of these 
> methods depends upon whether the {{CharSequence}} is a {{String}} or not.
> {code:java}
> StringBuilder builder = new StringBuilder();
> builder.appendCodePoint(0x2070E);
> System.out.println(StringUtils.lastIndexOf(builder, 0x2070E)); // -1
> System.out.println(StringUtils.lastIndexOf(builder.toString(), 0x2070E)); // 0
> {code}
> The Javadoc for these methods are ambiguous on this point, stating:
> {quote}
> This method uses {{String.lastIndexOf(int)}} if possible.
> {quote}
> I think we should consider updating the {{CharSequenceUtils}} methods used by 
> this class to convert all {{CharSequence}} parameters to strings, enabling 
> full code point support. The docs could be updated to make this crystal clear.
> There is a question of whether this breaks backwards compatibility.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[GitHub] commons-lang issue #251: LANG-1300: Change CharSequenceUtils to support supp...

2017-03-09 Thread coveralls
Github user coveralls commented on the issue:

https://github.com/apache/commons-lang/pull/251
  

[![Coverage 
Status](https://coveralls.io/builds/10513306/badge)](https://coveralls.io/builds/10513306)

Coverage increased (+0.004%) to 94.54% when pulling 
**b45435c950e6f6864671bdffde29e26cdc8ce15b on 
MarkDacek:Lang1300CharSequenceUtilsChange** into 
**6597c196521af500feef7a02610727eafa7ec1dc on apache:master**.



---
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

2017-03-09 Thread sebbASF
Github user sebbASF commented on the issue:

https://github.com/apache/commons-lang/pull/231
  
The new design is more flexible. So one could add Endianness for example.
[The code still does not check for duplicate values for the same key]

However I'm not sure that the chosen names fully agree with the common 
usage.

For example, architecture is often used for CISC, RISC etc.

The enums need to be carefully documented so their domain is clear.

I'm not sure it makes sense to have combined methods such as isPPC64JVM() 
which asserts that it is a PPC and 64bit JVM.

Also there is a usage issue: a false response may mean that the string is 
unknown. Even though there only two ProcessorArch values currently, one cannot 
assume that a string which is not 64 bit must therefore be 32 bit.

I wonder if it would not be simpler to just return the Processor entry.
The caller can then check the attributes in any combinations they want.

If there is no database entry, return a Process instance with enums which 
indicate "Unknown".
(Attribute enums would need an extra 'Unknown' entry).


---
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

2017-03-09 Thread sebbASF
Github user sebbASF commented on a diff in the pull request:

https://github.com/apache/commons-lang/pull/231#discussion_r105178700
  
--- Diff: 
src/main/java/org/apache/commons/lang3/tuple/ArchUtilsImproved.java ---
@@ -0,0 +1,400 @@
+package org.apache.commons.lang3.tuple;
+
+import org.apache.commons.lang3.ArchUtils;
+import org.apache.commons.lang3.SystemUtils;
+import org.apache.commons.lang3.arch.Processor;
+import org.apache.commons.lang3.arch.ProcessorArch;
+import org.apache.commons.lang3.arch.ProcessorType;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ *
+ */
+public class ArchUtilsImproved {
+
+private static Map map;
+
+static {
+map = new HashMap<>();
+init();
+}
+
+private static final void init() {
+init_X86_32Bit();
+init_X86_64Bit();
+init_IA64_32Bit();
+init_IA64_64Bit();
+init_PPA_32Bit();
+init_PPA_64Bit();
+}
+
+private static final void init_X86_32Bit() {
+Processor x86 = new Processor("x86", ProcessorArch.BIT_32, 
ProcessorType.X86);
+map.put(x86.getName(), x86);
+
+Processor i386 = new Processor("i386", ProcessorArch.BIT_32, 
ProcessorType.X86);
+map.put(i386.getName(), i386);
+
+Processor i486 = new Processor("i486", ProcessorArch.BIT_32, 
ProcessorType.X86);
+map.put(i486.getName(), i486);
+
+Processor i586 = new Processor("i586", ProcessorArch.BIT_32, 
ProcessorType.X86);
+map.put(i586.getName(), i586);
+
+Processor i686 = new Processor("i686", ProcessorArch.BIT_32, 
ProcessorType.X86);
+map.put(i686.getName(), i686);
+
+Processor pentium = new Processor("pentium", ProcessorArch.BIT_32, 
ProcessorType.X86);
+map.put(pentium.getName(), pentium);
+}
+
+private static final void init_X86_64Bit() {
+Processor x86_64 = new Processor("x86_64", ProcessorArch.BIT_64, 
ProcessorType.X86);
+map.put(x86_64.getName(), x86_64);
+
+Processor amd64 = new Processor("amd64", ProcessorArch.BIT_64, 
ProcessorType.X86);
+map.put(amd64.getName(), amd64);
+
+Processor em64t = new Processor("em64t", ProcessorArch.BIT_64, 
ProcessorType.X86);
+map.put(em64t.getName(), em64t);
+
+Processor universal = new Processor("universal", 
ProcessorArch.BIT_64, ProcessorType.X86);
+map.put(universal.getName(), universal);
+}
+
+private static final void init_IA64_32Bit() {
+Processor ia64_32 = new Processor("ia64_32", ProcessorArch.BIT_32, 
ProcessorType.IA_64);
+map.put(ia64_32.getName(), ia64_32);
+
+Processor ia64n = new Processor("ia64n", ProcessorArch.BIT_32, 
ProcessorType.IA_64);
+map.put(ia64n.getName(), ia64n);
+}
+
+private static final void init_IA64_64Bit() {
+Processor ia64 = new Processor("ia64", ProcessorArch.BIT_64, 
ProcessorType.IA_64);
+map.put(ia64.getName(), ia64);
+
+Processor ia64w = new Processor("ia64w", ProcessorArch.BIT_64, 
ProcessorType.IA_64);
+map.put(ia64w.getName(), ia64w);
+}
+
+private static final void init_PPA_32Bit() {
+Processor ppc = new Processor("ppc", ProcessorArch.BIT_32, 
ProcessorType.PPC);
+map.put(ppc.getName(), ppc);
+
+Processor power = new Processor("power", ProcessorArch.BIT_32, 
ProcessorType.PPC);
+map.put(power.getName(), power);
+
+Processor powerpc = new Processor("powerpc", ProcessorArch.BIT_32, 
ProcessorType.PPC);
+map.put(powerpc.getName(), powerpc);
+
+Processor power_pc = new Processor("power_pc", 
ProcessorArch.BIT_32, ProcessorType.PPC);
+map.put(power_pc.getName(), power_pc);
+
+Processor power_rs = new Processor("power_rs", 
ProcessorArch.BIT_32, ProcessorType.PPC);
+map.put(power_rs.getName(), power_rs);
+}
+
+private static final void init_PPA_64Bit() {
+Processor ppc64 = new Processor("ppc64", ProcessorArch.BIT_64, 
ProcessorType.PPC);
+map.put(ppc64.getName(), ppc64);
+
+Processor power64 = new Processor("power64", ProcessorArch.BIT_64, 
ProcessorType.PPC);
+map.put(power64.getName(), power64);
+
+Processor powerpc64 = new Processor("powerpc64", 
ProcessorArch.BIT_64, ProcessorType.PPC);
+map.put(powerpc64.getName(), powerpc64);
+
+Processor power_pc64 = new Processor("power_pc64", 
ProcessorArch.BIT_64, ProcessorType.PPC);
+map.put(power_pc64.getName(), power_pc64);
+

[GitHub] commons-lang pull request #231: Evaluate Architecure

2017-03-09 Thread sebbASF
Github user sebbASF commented on a diff in the pull request:

https://github.com/apache/commons-lang/pull/231#discussion_r105175128
  
--- 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 --

These should be final.
I don't think the name is needed.


---
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

2017-03-09 Thread Tomschi
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.
---


[jira] [Commented] (LANG-1315) FastDateParser parse method parses without considering timezone

2017-03-09 Thread Sebb (JIRA)

[ 
https://issues.apache.org/jira/browse/LANG-1315?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15902921#comment-15902921
 ] 

Sebb commented on LANG-1315:


The test case is hard to use as it's in two files buried deep in a file 
structure.

In future, please provide a single file which exihibts the problem.
Ideally as a unit test (LANG uses JUnit).

As it stands, the test proves nothing, as it does not compare the output of 
FastDateFormat with the output of SimpleDateFormat.

> FastDateParser parse method parses without considering timezone
> ---
>
> Key: LANG-1315
> URL: https://issues.apache.org/jira/browse/LANG-1315
> Project: Commons Lang
>  Issue Type: Bug
>Reporter: Sudheendra
>  Labels: DateParser, FastDateParser, parse
> Attachments: learn-fast-date.zip
>
>
> Using commons-lang3 3.5
> FastDateParser parse(String ,ParsePosition ) internally calls 
> calendar.getTime(). This method created a new Date object which will ignore 
> the timezone and locale. Hence will default to system TZ and locale.
> The parse should happen with respect to the formatter's time zone but that is 
> currently ignored



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Resolved] (LANG-1315) FastDateParser parse method parses without considering timezone

2017-03-09 Thread Sebb (JIRA)

 [ 
https://issues.apache.org/jira/browse/LANG-1315?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Sebb resolved LANG-1315.

Resolution: Cannot Reproduce

> FastDateParser parse method parses without considering timezone
> ---
>
> Key: LANG-1315
> URL: https://issues.apache.org/jira/browse/LANG-1315
> Project: Commons Lang
>  Issue Type: Bug
>Reporter: Sudheendra
>  Labels: DateParser, FastDateParser, parse
> Attachments: learn-fast-date.zip
>
>
> Using commons-lang3 3.5
> FastDateParser parse(String ,ParsePosition ) internally calls 
> calendar.getTime(). This method created a new Date object which will ignore 
> the timezone and locale. Hence will default to system TZ and locale.
> The parse should happen with respect to the formatter's time zone but that is 
> currently ignored



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Reopened] (CLI-269) Introduce CommandLine.Builder

2017-03-09 Thread Benedikt Ritter (JIRA)

 [ 
https://issues.apache.org/jira/browse/CLI-269?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Benedikt Ritter reopened CLI-269:
-

Reopening this issue to set it to "fixed". We only close issues after their fix 
version has been released.

> Introduce CommandLine.Builder
> -
>
> Key: CLI-269
> URL: https://issues.apache.org/jira/browse/CLI-269
> Project: Commons CLI
>  Issue Type: New Feature
>  Components: Build
>Affects Versions: 1.3.1
>Reporter: Robert Scholte
> Fix For: 1.4
>
> Attachments: commandlinebuilder.patch
>
>
> For Maven there are several places where one can define the commandline 
> arguments. These should be merged to 1 new commandline, but we need to have 
> control over the order in which these are merged.
> Best solution seems to be to introduce a CommandLineBuilder.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Resolved] (CLI-269) Introduce CommandLine.Builder

2017-03-09 Thread Benedikt Ritter (JIRA)

 [ 
https://issues.apache.org/jira/browse/CLI-269?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Benedikt Ritter resolved CLI-269.
-
Resolution: Fixed

> Introduce CommandLine.Builder
> -
>
> Key: CLI-269
> URL: https://issues.apache.org/jira/browse/CLI-269
> Project: Commons CLI
>  Issue Type: New Feature
>  Components: Build
>Affects Versions: 1.3.1
>Reporter: Robert Scholte
> Fix For: 1.4
>
> Attachments: commandlinebuilder.patch
>
>
> For Maven there are several places where one can define the commandline 
> arguments. These should be merged to 1 new commandline, but we need to have 
> control over the order in which these are merged.
> Best solution seems to be to introduce a CommandLineBuilder.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[GitHub] commons-lang issue #231: Evaluate Architecure

2017-03-09 Thread sebbASF
Github user sebbASF commented on the issue:

https://github.com/apache/commons-lang/pull/231
  
I wonder why the architecture String constants are not an enum?

Also, the various addxxx() methods don't check if there is already an 
entry, so it's possible to overwrite an existing value. This should be easy to 
fix (I suggest a common method to update the map called by all the others).

===

The current design assumes that a given OS string can only be in one of the 
classifications.
Will that always be the case?
At present checking for 64bit JVMs means knowing which classes are 64 bit 
etc.
It would be possible (but awkward) to add a method for isIntel.
Perhaps consider using separate flags for each attribute, instead of names 
for specific combinations of attributes. This would make it much easier to add 
new attributes, e.g. CISC,RISC


---
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

2017-03-09 Thread sebbASF
Github user sebbASF commented on the issue:

https://github.com/apache/commons-lang/pull/231
  
If the code is not going to allow updates, then there is no need to use 
ConcurrentHashMap.
If updates are allowed at run-time, there is the possibility that different 
results will be obtained at different times.

Alternatively, it's potentially possible to allow updates before first use 
of the data, but disallow them later.

This is the approach taken in Commons Validator


http://commons.apache.org/proper/commons-validator/xref/org/apache/commons/validator/routines/DomainValidator.html

This uses a flag to allow initial updates.
Users have to get an instance before using the class; this resets the flag 
to stop further changes.


---
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

2017-03-09 Thread Tomschi
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 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 pull request #231: Evaluate Architecure

2017-03-09 Thread kinow
Github user kinow commented on a diff in the pull request:

https://github.com/apache/commons-lang/pull/231#discussion_r105108037
  
--- 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 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<>();
+
+// x86 mappings
+addX86(X86);
+addX86("i386");
+addX86("i486");
+addX86("i586");
+addX86("i686");
+addX86("pentium");
+
+// x86_64 mappings
+addX86_64(X86_64);
+addX86_64("amd64");
+addX86_64("em64t");
+addX86_64("universal"); // Needed for openjdk7 in Mac
+
+// Itenium 64-bit mappings
+addIA64(IA64);
+addIA64("ia64w");
+
+// Itenium 32-bit mappings, usually an HP-UX construct
+addIA64_32(IA64_32);
+addIA64_32("ia64n");
+
+// PowerPC mappings
+addPPC(PPC);
+addPPC("power");
+addPPC("powerpc");
+addPPC("power_pc");
+addPPC("power_rs");
+
+// PowerPC 64bit mappings
+addPPC64(PPC64);
+addPPC64("power64");
+addPPC64("powerpc64");
+addPPC64("power_pc64");
+addPPC64("power_rs64");
+}
+
+/**
+ * Possibility to add {@link String}, representing the 
System.getProperty("os.arch")
+ * to x86 architecture.
+ *
+ * @param value The {@link String} to add.
+ */
+public static final void addX86(String value) {
+map.put(value, X86);
+}
+
+/**
+ * Checks if the current running JVM is a JVM for x86 architecture.
+ * It returns true, if the os.arch System Property 
matches the following {@link String}'s:
+ * 
+ * x86
+ * i386
+ * i486
+ * i586
+ * i686
+ * pentium
+ * 
+ * 
+ * It is possible to extend the {@link String}'s above using method 
{@link ArchUtils#addX86(String)}.
+ * 
+ * 
+ * Important: The os.arch System Property returns the architecture 
used by the JVM
+ * not of the operating system.
+ * 
+ *
+ * @return True if the current JVM is a x86 JVM, else 
false.
+ */
+public static final boolean isX86JVM() {
+return isX86JVM(SystemUtils.OS_ARCH);
+}
+
+/**
+ * Checks if the given {@link String} represents a x86 JVM. The {@link 

[GitHub] commons-lang pull request #231: Evaluate Architecure

2017-03-09 Thread kinow
Github user kinow commented on a diff in the pull request:

https://github.com/apache/commons-lang/pull/231#discussion_r105107714
  
--- 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 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<>();
+
+// x86 mappings
+addX86(X86);
+addX86("i386");
+addX86("i486");
+addX86("i586");
+addX86("i686");
+addX86("pentium");
+
+// x86_64 mappings
+addX86_64(X86_64);
+addX86_64("amd64");
+addX86_64("em64t");
+addX86_64("universal"); // Needed for openjdk7 in Mac
+
+// Itenium 64-bit mappings
+addIA64(IA64);
+addIA64("ia64w");
+
+// Itenium 32-bit mappings, usually an HP-UX construct
+addIA64_32(IA64_32);
+addIA64_32("ia64n");
+
+// PowerPC mappings
+addPPC(PPC);
+addPPC("power");
+addPPC("powerpc");
+addPPC("power_pc");
+addPPC("power_rs");
+
+// PowerPC 64bit mappings
+addPPC64(PPC64);
+addPPC64("power64");
+addPPC64("powerpc64");
+addPPC64("power_pc64");
+addPPC64("power_rs64");
+}
+
+/**
+ * Possibility to add {@link String}, representing the 
System.getProperty("os.arch")
+ * to x86 architecture.
+ *
+ * @param value The {@link String} to add.
+ */
+public static final void addX86(String value) {
+map.put(value, X86);
+}
+
+/**
+ * Checks if the current running JVM is a JVM for x86 architecture.
+ * It returns true, if the os.arch System Property 
matches the following {@link String}'s:
+ * 
+ * x86
+ * i386
+ * i486
+ * i586
+ * i686
+ * pentium
+ * 
+ * 
+ * It is possible to extend the {@link String}'s above using method 
{@link ArchUtils#addX86(String)}.
+ * 
+ * 
+ * Important: The os.arch System Property returns the architecture 
used by the JVM
+ * not of the operating system.
+ * 
+ *
+ * @return True if the current JVM is a x86 JVM, else 
false.
+ */
+public static final boolean isX86JVM() {
+return isX86JVM(SystemUtils.OS_ARCH);
+}
+
+/**
+ * Checks if the given {@link String} represents a x86 JVM. The {@link 

[GitHub] commons-lang pull request #231: Evaluate Architecure

2017-03-09 Thread kinow
Github user kinow commented on a diff in the pull request:

https://github.com/apache/commons-lang/pull/231#discussion_r105108083
  
--- 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 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<>();
+
+// x86 mappings
+addX86(X86);
+addX86("i386");
+addX86("i486");
+addX86("i586");
+addX86("i686");
+addX86("pentium");
+
+// x86_64 mappings
+addX86_64(X86_64);
+addX86_64("amd64");
+addX86_64("em64t");
+addX86_64("universal"); // Needed for openjdk7 in Mac
+
+// Itenium 64-bit mappings
+addIA64(IA64);
+addIA64("ia64w");
+
+// Itenium 32-bit mappings, usually an HP-UX construct
+addIA64_32(IA64_32);
+addIA64_32("ia64n");
+
+// PowerPC mappings
+addPPC(PPC);
+addPPC("power");
+addPPC("powerpc");
+addPPC("power_pc");
+addPPC("power_rs");
+
+// PowerPC 64bit mappings
+addPPC64(PPC64);
+addPPC64("power64");
+addPPC64("powerpc64");
+addPPC64("power_pc64");
+addPPC64("power_rs64");
+}
+
+/**
+ * Possibility to add {@link String}, representing the 
System.getProperty("os.arch")
+ * to x86 architecture.
+ *
+ * @param value The {@link String} to add.
+ */
+public static final void addX86(String value) {
+map.put(value, X86);
+}
+
+/**
+ * Checks if the current running JVM is a JVM for x86 architecture.
+ * It returns true, if the os.arch System Property 
matches the following {@link String}'s:
+ * 
+ * x86
+ * i386
+ * i486
+ * i586
+ * i686
+ * pentium
+ * 
+ * 
+ * It is possible to extend the {@link String}'s above using method 
{@link ArchUtils#addX86(String)}.
+ * 
+ * 
+ * Important: The os.arch System Property returns the architecture 
used by the JVM
+ * not of the operating system.
+ * 
+ *
+ * @return True if the current JVM is a x86 JVM, else 
false.
+ */
+public static final boolean isX86JVM() {
+return isX86JVM(SystemUtils.OS_ARCH);
+}
+
+/**
+ * Checks if the given {@link String} represents a x86 JVM. The {@link 

[GitHub] commons-lang pull request #231: Evaluate Architecure

2017-03-09 Thread kinow
Github user kinow commented on a diff in the pull request:

https://github.com/apache/commons-lang/pull/231#discussion_r105108009
  
--- 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 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<>();
+
+// x86 mappings
+addX86(X86);
+addX86("i386");
+addX86("i486");
+addX86("i586");
+addX86("i686");
+addX86("pentium");
+
+// x86_64 mappings
+addX86_64(X86_64);
+addX86_64("amd64");
+addX86_64("em64t");
+addX86_64("universal"); // Needed for openjdk7 in Mac
+
+// Itenium 64-bit mappings
+addIA64(IA64);
+addIA64("ia64w");
+
+// Itenium 32-bit mappings, usually an HP-UX construct
+addIA64_32(IA64_32);
+addIA64_32("ia64n");
+
+// PowerPC mappings
+addPPC(PPC);
+addPPC("power");
+addPPC("powerpc");
+addPPC("power_pc");
+addPPC("power_rs");
+
+// PowerPC 64bit mappings
+addPPC64(PPC64);
+addPPC64("power64");
+addPPC64("powerpc64");
+addPPC64("power_pc64");
+addPPC64("power_rs64");
+}
+
+/**
+ * Possibility to add {@link String}, representing the 
System.getProperty("os.arch")
+ * to x86 architecture.
+ *
+ * @param value The {@link String} to add.
+ */
+public static final void addX86(String value) {
+map.put(value, X86);
+}
+
+/**
+ * Checks if the current running JVM is a JVM for x86 architecture.
+ * It returns true, if the os.arch System Property 
matches the following {@link String}'s:
+ * 
+ * x86
+ * i386
+ * i486
+ * i586
+ * i686
+ * pentium
+ * 
+ * 
+ * It is possible to extend the {@link String}'s above using method 
{@link ArchUtils#addX86(String)}.
+ * 
--- End diff --



Minor bug in Javadoc HTML. Extra opening paragraph. Can be fixed later too.



---
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

2017-03-09 Thread kinow
Github user kinow commented on a diff in the pull request:

https://github.com/apache/commons-lang/pull/231#discussion_r105108108
  
--- 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 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<>();
+
+// x86 mappings
+addX86(X86);
+addX86("i386");
+addX86("i486");
+addX86("i586");
+addX86("i686");
+addX86("pentium");
+
+// x86_64 mappings
+addX86_64(X86_64);
+addX86_64("amd64");
+addX86_64("em64t");
+addX86_64("universal"); // Needed for openjdk7 in Mac
+
+// Itenium 64-bit mappings
+addIA64(IA64);
+addIA64("ia64w");
+
+// Itenium 32-bit mappings, usually an HP-UX construct
+addIA64_32(IA64_32);
+addIA64_32("ia64n");
+
+// PowerPC mappings
+addPPC(PPC);
+addPPC("power");
+addPPC("powerpc");
+addPPC("power_pc");
+addPPC("power_rs");
+
+// PowerPC 64bit mappings
+addPPC64(PPC64);
+addPPC64("power64");
+addPPC64("powerpc64");
+addPPC64("power_pc64");
+addPPC64("power_rs64");
+}
+
+/**
+ * Possibility to add {@link String}, representing the 
System.getProperty("os.arch")
+ * to x86 architecture.
+ *
+ * @param value The {@link String} to add.
+ */
+public static final void addX86(String value) {
+map.put(value, X86);
+}
+
+/**
+ * Checks if the current running JVM is a JVM for x86 architecture.
+ * It returns true, if the os.arch System Property 
matches the following {@link String}'s:
+ * 
+ * x86
+ * i386
+ * i486
+ * i586
+ * i686
+ * pentium
+ * 
+ * 
+ * It is possible to extend the {@link String}'s above using method 
{@link ArchUtils#addX86(String)}.
+ * 
+ * 
+ * Important: The os.arch System Property returns the architecture 
used by the JVM
+ * not of the operating system.
+ * 
+ *
+ * @return True if the current JVM is a x86 JVM, else 
false.
+ */
+public static final boolean isX86JVM() {
+return isX86JVM(SystemUtils.OS_ARCH);
+}
+
+/**
+ * Checks if the given {@link String} represents a x86 JVM. The {@link 

[GitHub] commons-lang pull request #231: Evaluate Architecure

2017-03-09 Thread kinow
Github user kinow commented on a diff in the pull request:

https://github.com/apache/commons-lang/pull/231#discussion_r105108206
  
--- 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 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<>();
+
+// x86 mappings
+addX86(X86);
+addX86("i386");
+addX86("i486");
+addX86("i586");
+addX86("i686");
+addX86("pentium");
+
+// x86_64 mappings
+addX86_64(X86_64);
+addX86_64("amd64");
+addX86_64("em64t");
+addX86_64("universal"); // Needed for openjdk7 in Mac
+
+// Itenium 64-bit mappings
+addIA64(IA64);
+addIA64("ia64w");
+
+// Itenium 32-bit mappings, usually an HP-UX construct
+addIA64_32(IA64_32);
+addIA64_32("ia64n");
+
+// PowerPC mappings
+addPPC(PPC);
+addPPC("power");
+addPPC("powerpc");
+addPPC("power_pc");
+addPPC("power_rs");
+
+// PowerPC 64bit mappings
+addPPC64(PPC64);
+addPPC64("power64");
+addPPC64("powerpc64");
+addPPC64("power_pc64");
+addPPC64("power_rs64");
+}
+
+/**
+ * Possibility to add {@link String}, representing the 
System.getProperty("os.arch")
+ * to x86 architecture.
+ *
+ * @param value The {@link String} to add.
+ */
+public static final void addX86(String value) {
+map.put(value, X86);
+}
+
+/**
+ * Checks if the current running JVM is a JVM for x86 architecture.
+ * It returns true, if the os.arch System Property 
matches the following {@link String}'s:
+ * 
+ * x86
+ * i386
+ * i486
+ * i586
+ * i686
+ * pentium
+ * 
+ * 
+ * It is possible to extend the {@link String}'s above using method 
{@link ArchUtils#addX86(String)}.
+ * 
+ * 
+ * Important: The os.arch System Property returns the architecture 
used by the JVM
+ * not of the operating system.
+ * 
+ *
+ * @return True if the current JVM is a x86 JVM, else 
false.
+ */
+public static final boolean isX86JVM() {
+return isX86JVM(SystemUtils.OS_ARCH);
+}
+
+/**
+ * Checks if the given {@link String} represents a x86 JVM. The {@link 

[GitHub] commons-lang pull request #231: Evaluate Architecure

2017-03-09 Thread kinow
Github user kinow commented on a diff in the pull request:

https://github.com/apache/commons-lang/pull/231#discussion_r105108158
  
--- 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 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<>();
+
+// x86 mappings
+addX86(X86);
+addX86("i386");
+addX86("i486");
+addX86("i586");
+addX86("i686");
+addX86("pentium");
+
+// x86_64 mappings
+addX86_64(X86_64);
+addX86_64("amd64");
+addX86_64("em64t");
+addX86_64("universal"); // Needed for openjdk7 in Mac
+
+// Itenium 64-bit mappings
+addIA64(IA64);
+addIA64("ia64w");
+
+// Itenium 32-bit mappings, usually an HP-UX construct
+addIA64_32(IA64_32);
+addIA64_32("ia64n");
+
+// PowerPC mappings
+addPPC(PPC);
+addPPC("power");
+addPPC("powerpc");
+addPPC("power_pc");
+addPPC("power_rs");
+
+// PowerPC 64bit mappings
+addPPC64(PPC64);
+addPPC64("power64");
+addPPC64("powerpc64");
+addPPC64("power_pc64");
+addPPC64("power_rs64");
+}
+
+/**
+ * Possibility to add {@link String}, representing the 
System.getProperty("os.arch")
+ * to x86 architecture.
+ *
+ * @param value The {@link String} to add.
+ */
+public static final void addX86(String value) {
+map.put(value, X86);
+}
+
+/**
+ * Checks if the current running JVM is a JVM for x86 architecture.
+ * It returns true, if the os.arch System Property 
matches the following {@link String}'s:
+ * 
+ * x86
+ * i386
+ * i486
+ * i586
+ * i686
+ * pentium
+ * 
+ * 
+ * It is possible to extend the {@link String}'s above using method 
{@link ArchUtils#addX86(String)}.
+ * 
+ * 
+ * Important: The os.arch System Property returns the architecture 
used by the JVM
+ * not of the operating system.
+ * 
+ *
+ * @return True if the current JVM is a x86 JVM, else 
false.
+ */
+public static final boolean isX86JVM() {
+return isX86JVM(SystemUtils.OS_ARCH);
+}
+
+/**
+ * Checks if the given {@link String} represents a x86 JVM. The {@link 

[GitHub] commons-lang pull request #231: Evaluate Architecure

2017-03-09 Thread kinow
Github user kinow commented on a diff in the pull request:

https://github.com/apache/commons-lang/pull/231#discussion_r105108139
  
--- 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 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<>();
+
+// x86 mappings
+addX86(X86);
+addX86("i386");
+addX86("i486");
+addX86("i586");
+addX86("i686");
+addX86("pentium");
+
+// x86_64 mappings
+addX86_64(X86_64);
+addX86_64("amd64");
+addX86_64("em64t");
+addX86_64("universal"); // Needed for openjdk7 in Mac
+
+// Itenium 64-bit mappings
+addIA64(IA64);
+addIA64("ia64w");
+
+// Itenium 32-bit mappings, usually an HP-UX construct
+addIA64_32(IA64_32);
+addIA64_32("ia64n");
+
+// PowerPC mappings
+addPPC(PPC);
+addPPC("power");
+addPPC("powerpc");
+addPPC("power_pc");
+addPPC("power_rs");
+
+// PowerPC 64bit mappings
+addPPC64(PPC64);
+addPPC64("power64");
+addPPC64("powerpc64");
+addPPC64("power_pc64");
+addPPC64("power_rs64");
+}
+
+/**
+ * Possibility to add {@link String}, representing the 
System.getProperty("os.arch")
+ * to x86 architecture.
+ *
+ * @param value The {@link String} to add.
+ */
+public static final void addX86(String value) {
+map.put(value, X86);
+}
+
+/**
+ * Checks if the current running JVM is a JVM for x86 architecture.
+ * It returns true, if the os.arch System Property 
matches the following {@link String}'s:
+ * 
+ * x86
+ * i386
+ * i486
+ * i586
+ * i686
+ * pentium
+ * 
+ * 
+ * It is possible to extend the {@link String}'s above using method 
{@link ArchUtils#addX86(String)}.
+ * 
+ * 
+ * Important: The os.arch System Property returns the architecture 
used by the JVM
+ * not of the operating system.
+ * 
+ *
+ * @return True if the current JVM is a x86 JVM, else 
false.
+ */
+public static final boolean isX86JVM() {
+return isX86JVM(SystemUtils.OS_ARCH);
+}
+
+/**
+ * Checks if the given {@link String} represents a x86 JVM. The {@link 

[GitHub] commons-lang pull request #231: Evaluate Architecure

2017-03-09 Thread kinow
Github user kinow commented on a diff in the pull request:

https://github.com/apache/commons-lang/pull/231#discussion_r105108059
  
--- 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 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<>();
+
+// x86 mappings
+addX86(X86);
+addX86("i386");
+addX86("i486");
+addX86("i586");
+addX86("i686");
+addX86("pentium");
+
+// x86_64 mappings
+addX86_64(X86_64);
+addX86_64("amd64");
+addX86_64("em64t");
+addX86_64("universal"); // Needed for openjdk7 in Mac
+
+// Itenium 64-bit mappings
+addIA64(IA64);
+addIA64("ia64w");
+
+// Itenium 32-bit mappings, usually an HP-UX construct
+addIA64_32(IA64_32);
+addIA64_32("ia64n");
+
+// PowerPC mappings
+addPPC(PPC);
+addPPC("power");
+addPPC("powerpc");
+addPPC("power_pc");
+addPPC("power_rs");
+
+// PowerPC 64bit mappings
+addPPC64(PPC64);
+addPPC64("power64");
+addPPC64("powerpc64");
+addPPC64("power_pc64");
+addPPC64("power_rs64");
+}
+
+/**
+ * Possibility to add {@link String}, representing the 
System.getProperty("os.arch")
+ * to x86 architecture.
+ *
+ * @param value The {@link String} to add.
+ */
+public static final void addX86(String value) {
+map.put(value, X86);
+}
+
+/**
+ * Checks if the current running JVM is a JVM for x86 architecture.
+ * It returns true, if the os.arch System Property 
matches the following {@link String}'s:
+ * 
+ * x86
+ * i386
+ * i486
+ * i586
+ * i686
+ * pentium
+ * 
+ * 
+ * It is possible to extend the {@link String}'s above using method 
{@link ArchUtils#addX86(String)}.
+ * 
+ * 
+ * Important: The os.arch System Property returns the architecture 
used by the JVM
+ * not of the operating system.
+ * 
+ *
+ * @return True if the current JVM is a x86 JVM, else 
false.
+ */
+public static final boolean isX86JVM() {
+return isX86JVM(SystemUtils.OS_ARCH);
+}
+
+/**
+ * Checks if the given {@link String} represents a x86 JVM. The {@link 

[GitHub] commons-lang pull request #231: Evaluate Architecure

2017-03-09 Thread kinow
Github user kinow commented on a diff in the pull request:

https://github.com/apache/commons-lang/pull/231#discussion_r105108338
  
--- 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 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<>();
+
+// x86 mappings
+addX86(X86);
+addX86("i386");
+addX86("i486");
+addX86("i586");
+addX86("i686");
+addX86("pentium");
+
+// x86_64 mappings
+addX86_64(X86_64);
+addX86_64("amd64");
+addX86_64("em64t");
+addX86_64("universal"); // Needed for openjdk7 in Mac
+
+// Itenium 64-bit mappings
+addIA64(IA64);
+addIA64("ia64w");
+
+// Itenium 32-bit mappings, usually an HP-UX construct
+addIA64_32(IA64_32);
+addIA64_32("ia64n");
+
+// PowerPC mappings
+addPPC(PPC);
+addPPC("power");
+addPPC("powerpc");
+addPPC("power_pc");
+addPPC("power_rs");
+
+// PowerPC 64bit mappings
+addPPC64(PPC64);
+addPPC64("power64");
+addPPC64("powerpc64");
+addPPC64("power_pc64");
+addPPC64("power_rs64");
+}
+
+/**
+ * Possibility to add {@link String}, representing the 
System.getProperty("os.arch")
+ * to x86 architecture.
+ *
+ * @param value The {@link String} to add.
+ */
+public static final void addX86(String value) {
+map.put(value, X86);
+}
+
+/**
+ * Checks if the current running JVM is a JVM for x86 architecture.
+ * It returns true, if the os.arch System Property 
matches the following {@link String}'s:
+ * 
+ * x86
+ * i386
+ * i486
+ * i586
+ * i686
+ * pentium
+ * 
+ * 
+ * It is possible to extend the {@link String}'s above using method 
{@link ArchUtils#addX86(String)}.
+ * 
+ * 
+ * Important: The os.arch System Property returns the architecture 
used by the JVM
+ * not of the operating system.
+ * 
+ *
+ * @return True if the current JVM is a x86 JVM, else 
false.
+ */
+public static final boolean isX86JVM() {
+return isX86JVM(SystemUtils.OS_ARCH);
+}
+
+/**
+ * Checks if the given {@link String} represents a x86 JVM. The {@link 

[GitHub] commons-lang pull request #231: Evaluate Architecure

2017-03-09 Thread kinow
Github user kinow commented on a diff in the pull request:

https://github.com/apache/commons-lang/pull/231#discussion_r105106940
  
--- 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
--- End diff --

Author classes are not used any more in Commons. We have removed most, and 
now we maintain the list of contributors in the source control tool + pom.xml.


---
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

2017-03-09 Thread kinow
Github user kinow commented on a diff in the pull request:

https://github.com/apache/commons-lang/pull/231#discussion_r105108179
  
--- 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 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<>();
+
+// x86 mappings
+addX86(X86);
+addX86("i386");
+addX86("i486");
+addX86("i586");
+addX86("i686");
+addX86("pentium");
+
+// x86_64 mappings
+addX86_64(X86_64);
+addX86_64("amd64");
+addX86_64("em64t");
+addX86_64("universal"); // Needed for openjdk7 in Mac
+
+// Itenium 64-bit mappings
+addIA64(IA64);
+addIA64("ia64w");
+
+// Itenium 32-bit mappings, usually an HP-UX construct
+addIA64_32(IA64_32);
+addIA64_32("ia64n");
+
+// PowerPC mappings
+addPPC(PPC);
+addPPC("power");
+addPPC("powerpc");
+addPPC("power_pc");
+addPPC("power_rs");
+
+// PowerPC 64bit mappings
+addPPC64(PPC64);
+addPPC64("power64");
+addPPC64("powerpc64");
+addPPC64("power_pc64");
+addPPC64("power_rs64");
+}
+
+/**
+ * Possibility to add {@link String}, representing the 
System.getProperty("os.arch")
+ * to x86 architecture.
+ *
+ * @param value The {@link String} to add.
+ */
+public static final void addX86(String value) {
+map.put(value, X86);
+}
+
+/**
+ * Checks if the current running JVM is a JVM for x86 architecture.
+ * It returns true, if the os.arch System Property 
matches the following {@link String}'s:
+ * 
+ * x86
+ * i386
+ * i486
+ * i586
+ * i686
+ * pentium
+ * 
+ * 
+ * It is possible to extend the {@link String}'s above using method 
{@link ArchUtils#addX86(String)}.
+ * 
+ * 
+ * Important: The os.arch System Property returns the architecture 
used by the JVM
+ * not of the operating system.
+ * 
+ *
+ * @return True if the current JVM is a x86 JVM, else 
false.
+ */
+public static final boolean isX86JVM() {
+return isX86JVM(SystemUtils.OS_ARCH);
+}
+
+/**
+ * Checks if the given {@link String} represents a x86 JVM. The {@link 

[GitHub] commons-lang pull request #231: Evaluate Architecure

2017-03-09 Thread kinow
Github user kinow commented on a diff in the pull request:

https://github.com/apache/commons-lang/pull/231#discussion_r105107852
  
--- 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.
+ * 
--- End diff --

Minor bug in Javadoc HTML. Extra opening paragraph. Can be fixed later too.


---
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

2017-03-09 Thread kinow
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.
+ * 
+ * 
+ * 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 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.
---