[jira] [Commented] (LANG-1404) BooleanUtils.toBoolean(Integer) method added

2018-07-12 Thread Ruslan Sibgatullin (JIRA)


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

Ruslan Sibgatullin commented on LANG-1404:
--

[~s...@apache.org] whenever there's a nullable Integer to convert into boolean. 
As I wrote in the description - now it's doable but either with 2 if statements 
or with two methods. 

> BooleanUtils.toBoolean(Integer) method added
> 
>
> Key: LANG-1404
> URL: https://issues.apache.org/jira/browse/LANG-1404
> Project: Commons Lang
>  Issue Type: Improvement
>  Components: lang.*
>Reporter: Ruslan Sibgatullin
>Priority: Minor
>
> Right now to convert an Integer to boolean there is either a null check 
> needed:
> {{final Integer value = 1;}}
>  {{if (value != null) {}}
>  {{    if(BooleanUtils.toBoolean(value)) {}}
> {{        // some code}}
>       }
>  {{}}}
> or two methods call:
>  
> {{final Integer value = 1;}}
>  {{final Boolean b = BooleanUtils.toBooleanObject(value);}}
>  {{if (BooleanUtils.toBoolean(b)) {}}
>  {{    // some code}}
>  {{}}}
> Some code-sugar is added with the help of method that accepts Integer and 
> returns boolean:
> {{final Integer value = 1;}}
>  {{if (BooleanUtils.toBoolean(value)) {}}
>       // some code
>  {{}}}
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (COMPRESS-459) CPIO fails decoding multibyte name entries

2018-07-12 Thread Stefan Bodewig (JIRA)


[ 
https://issues.apache.org/jira/browse/COMPRESS-459?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16542595#comment-16542595
 ] 

Stefan Bodewig commented on COMPRESS-459:
-

Not immediately unless somebody else cuts the release (upcoming vacation for 
me). I want to add a proper test for COMPRESS-455 before cutting a new release 
which will be 1.18 when I'm back.

> CPIO fails decoding multibyte name entries
> --
>
> Key: COMPRESS-459
> URL: https://issues.apache.org/jira/browse/COMPRESS-459
> Project: Commons Compress
>  Issue Type: Bug
>  Components: Archivers
>Affects Versions: 1.9, 1.17
>Reporter: Jens Reimann
>Priority: Major
>  Labels: patch-available
> Fix For: 1.18
>
>
> Having a CPIO archive in (e.g. UTF-8) mode and having a name entry with a 
> name containing multi-byte characters the decoder fails.
> The problem IMHO is the "getHeaderPadCount" method, which assumes a single 
> byte per character:
>  
> {code:java}
>     public int getHeaderPadCount(){
>     if (this.alignmentBoundary == 0) { return 0; }
>     int size = this.headerSize + 1;  // Name has terminating null
>     if (name != null) {
>     size += name.length();
>     }
>     final int remain = size % this.alignmentBoundary;
>     if (remain > 0){
>     return this.alignmentBoundary - remain;
>     }
>     return 0;
>     }
> {code}
> However this may (or may not) be true for UTF-8.
>  
> Also it wouldn't be enough to call "String#getBytes(…)" as this might already 
> transform the underlying bytes.
> The proper solution would be to provide the name size, as read from the CPIO 
> stream, and pass it to the entry.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (LANG-1404) BooleanUtils.toBoolean(Integer) method added

2018-07-12 Thread Sebb (JIRA)


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

Sebb commented on LANG-1404:


What is the use case for this method?

> BooleanUtils.toBoolean(Integer) method added
> 
>
> Key: LANG-1404
> URL: https://issues.apache.org/jira/browse/LANG-1404
> Project: Commons Lang
>  Issue Type: Improvement
>  Components: lang.*
>Reporter: Ruslan Sibgatullin
>Priority: Minor
>
> Right now to convert an Integer to boolean there is either a null check 
> needed:
> {{final Integer value = 1;}}
>  {{if (value != null) {}}
>  {{    if(BooleanUtils.toBoolean(value)) {}}
> {{        // some code}}
>       }
>  {{}}}
> or two methods call:
>  
> {{final Integer value = 1;}}
>  {{final Boolean b = BooleanUtils.toBooleanObject(value);}}
>  {{if (BooleanUtils.toBoolean(b)) {}}
>  {{    // some code}}
>  {{}}}
> Some code-sugar is added with the help of method that accepts Integer and 
> returns boolean:
> {{final Integer value = 1;}}
>  {{if (BooleanUtils.toBoolean(value)) {}}
>       // some code
>  {{}}}
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (LANG-1404) BooleanUtils.toBoolean(Integer) method added

2018-07-12 Thread ASF GitHub Bot (JIRA)


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

ASF GitHub Bot commented on LANG-1404:
--

Github user coveralls commented on the issue:

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

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

Coverage increased (+0.0003%) to 95.244% when pulling 
**32c833822e51d362b08f6f5c8fa6ca42abd53bd6 on Enigo:LANG-1404_boolean_utils** 
into **c241b096d32f9ece918466f3614c143e8679dac5 on apache:master**.



> BooleanUtils.toBoolean(Integer) method added
> 
>
> Key: LANG-1404
> URL: https://issues.apache.org/jira/browse/LANG-1404
> Project: Commons Lang
>  Issue Type: Improvement
>  Components: lang.*
>Reporter: Ruslan Sibgatullin
>Priority: Minor
>
> Right now to convert an Integer to boolean there is either a null check 
> needed:
> {{final Integer value = 1;}}
>  {{if (value != null) {}}
>  {{    if(BooleanUtils.toBoolean(value)) {}}
> {{        // some code}}
>       }
>  {{}}}
> or two methods call:
>  
> {{final Integer value = 1;}}
>  {{final Boolean b = BooleanUtils.toBooleanObject(value);}}
>  {{if (BooleanUtils.toBoolean(b)) {}}
>  {{    // some code}}
>  {{}}}
> Some code-sugar is added with the help of method that accepts Integer and 
> returns boolean:
> {{final Integer value = 1;}}
>  {{if (BooleanUtils.toBoolean(value)) {}}
>       // some code
>  {{}}}
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (LANG-1404) BooleanUtils.toBoolean(Integer) method added

2018-07-12 Thread ASF GitHub Bot (JIRA)


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

ASF GitHub Bot commented on LANG-1404:
--

Github user coveralls commented on the issue:

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

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

Coverage increased (+0.0003%) to 95.244% when pulling 
**32c833822e51d362b08f6f5c8fa6ca42abd53bd6 on Enigo:LANG-1404_boolean_utils** 
into **c241b096d32f9ece918466f3614c143e8679dac5 on apache:master**.



> BooleanUtils.toBoolean(Integer) method added
> 
>
> Key: LANG-1404
> URL: https://issues.apache.org/jira/browse/LANG-1404
> Project: Commons Lang
>  Issue Type: Improvement
>  Components: lang.*
>Reporter: Ruslan Sibgatullin
>Priority: Minor
>
> Right now to convert an Integer to boolean there is either a null check 
> needed:
> {{final Integer value = 1;}}
>  {{if (value != null) {}}
>  {{    if(BooleanUtils.toBoolean(value)) {}}
> {{        // some code}}
>       }
>  {{}}}
> or two methods call:
>  
> {{final Integer value = 1;}}
>  {{final Boolean b = BooleanUtils.toBooleanObject(value);}}
>  {{if (BooleanUtils.toBoolean(b)) {}}
>  {{    // some code}}
>  {{}}}
> Some code-sugar is added with the help of method that accepts Integer and 
> returns boolean:
> {{final Integer value = 1;}}
>  {{if (BooleanUtils.toBoolean(value)) {}}
>       // some code
>  {{}}}
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[GitHub] commons-lang issue #337: LANG-1404 BooleanUtils.toBoolean(Integer) method ad...

2018-07-12 Thread coveralls
Github user coveralls commented on the issue:

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

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

Coverage increased (+0.0003%) to 95.244% when pulling 
**32c833822e51d362b08f6f5c8fa6ca42abd53bd6 on Enigo:LANG-1404_boolean_utils** 
into **c241b096d32f9ece918466f3614c143e8679dac5 on apache:master**.



---


[GitHub] commons-lang issue #337: LANG-1404 BooleanUtils.toBoolean(Integer) method ad...

2018-07-12 Thread coveralls
Github user coveralls commented on the issue:

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

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

Coverage increased (+0.0003%) to 95.244% when pulling 
**32c833822e51d362b08f6f5c8fa6ca42abd53bd6 on Enigo:LANG-1404_boolean_utils** 
into **c241b096d32f9ece918466f3614c143e8679dac5 on apache:master**.



---


[jira] [Commented] (LANG-1404) BooleanUtils.toBoolean(Integer) method added

2018-07-12 Thread ASF GitHub Bot (JIRA)


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

ASF GitHub Bot commented on LANG-1404:
--

GitHub user Enigo opened a pull request:

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

LANG-1404 BooleanUtils.toBoolean(Integer) method added

Right now to convert an Integer to boolean there is either a null check 
needed:
```
final Integer value = 1;
if (value != null) {
if(BooleanUtils.toBoolean(value)) {
// some code
  }
}
```
or two methods call:
```
final Integer value = 1;
final Boolean b = BooleanUtils.toBooleanObject(value);
if (BooleanUtils.toBoolean(b)) {
// some code
}
```

Some code-sugar is added with the help of method that accepts Integer and 
returns boolean:
```
final Integer value = 1;
if (BooleanUtils.toBoolean(value)) {
  // some code
}
```

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

$ git pull https://github.com/Enigo/commons-lang LANG-1404_boolean_utils

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

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


commit ad5679462ee3751b34122113cd698d05b9545e8b
Author: Ruslan Sibgatullin 
Date:   2018-07-12T20:13:31Z

LANG-1404 BooleanUtils.toBoolean(Integer) method added




> BooleanUtils.toBoolean(Integer) method added
> 
>
> Key: LANG-1404
> URL: https://issues.apache.org/jira/browse/LANG-1404
> Project: Commons Lang
>  Issue Type: Improvement
>  Components: lang.*
>Reporter: Ruslan Sibgatullin
>Priority: Minor
>
> Right now to convert an Integer to boolean there is either a null check 
> needed:
> {{final Integer value = 1;}}
>  {{if (value != null) {}}
>  {{    if(BooleanUtils.toBoolean(value)) {}}
> {{        // some code}}
>       }
>  {{}}}
> or two methods call:
>  
> {{final Integer value = 1;}}
>  {{final Boolean b = BooleanUtils.toBooleanObject(value);}}
>  {{if (BooleanUtils.toBoolean(b)) {}}
>  {{    // some code}}
>  {{}}}
> Some code-sugar is added with the help of method that accepts Integer and 
> returns boolean:
> {{final Integer value = 1;}}
>  {{if (BooleanUtils.toBoolean(value)) {}}
>       // some code
>  {{}}}
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[GitHub] commons-lang pull request #337: LANG-1404 BooleanUtils.toBoolean(Integer) me...

2018-07-12 Thread Enigo
GitHub user Enigo opened a pull request:

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

LANG-1404 BooleanUtils.toBoolean(Integer) method added

Right now to convert an Integer to boolean there is either a null check 
needed:
```
final Integer value = 1;
if (value != null) {
if(BooleanUtils.toBoolean(value)) {
// some code
  }
}
```
or two methods call:
```
final Integer value = 1;
final Boolean b = BooleanUtils.toBooleanObject(value);
if (BooleanUtils.toBoolean(b)) {
// some code
}
```

Some code-sugar is added with the help of method that accepts Integer and 
returns boolean:
```
final Integer value = 1;
if (BooleanUtils.toBoolean(value)) {
  // some code
}
```

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

$ git pull https://github.com/Enigo/commons-lang LANG-1404_boolean_utils

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

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


commit ad5679462ee3751b34122113cd698d05b9545e8b
Author: Ruslan Sibgatullin 
Date:   2018-07-12T20:13:31Z

LANG-1404 BooleanUtils.toBoolean(Integer) method added




---


[jira] [Updated] (LANG-1404) BooleanUtils.toBoolean(Integer) method added

2018-07-12 Thread Ruslan Sibgatullin (JIRA)


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

Ruslan Sibgatullin updated LANG-1404:
-
Description: 
Right now to convert an Integer to boolean there is either a null check needed:

{{final Integer value = 1;}}
 {{if (value != null) {}}
 {{    if(BooleanUtils.toBoolean(value)) {}}

{{        // some code}}

      }
 {{}}}

or two methods call:

 

{{final Integer value = 1;}}
 {{final Boolean b = BooleanUtils.toBooleanObject(value);}}
 {{if (BooleanUtils.toBoolean(b)) {}}
 {{    // some code}}
 {{}}}

Some code-sugar is added with the help of method that accepts Integer and 
returns boolean:

{{final Integer value = 1;}}
 {{if (BooleanUtils.toBoolean(value)) {}}
 \{{     // some code}}
 {{}}}

 

  was:
Right now to convert an Integer to boolean there is either a null check needed:

{{final Integer value = 1;}}
{{if (value != null) {}}
{{    if(BooleanUtils.toBoolean(value)) {}}

{{        // some code}}

{{    }}}
{{}}}

or two methods call:

 

{{final Integer value = 1;}}
{{final Boolean b = BooleanUtils.toBooleanObject(value);}}
{{if (BooleanUtils.toBoolean(b)) {}}
{{    // some code}}
{{}}}

Some code-sugar is added with the help of method that accepts Integer and 
returns boolean:

{{final Integer value = 1;}}
{{if (BooleanUtils.toBoolean(value)) {}}
{{     // some code}}
{{}}}

 


> BooleanUtils.toBoolean(Integer) method added
> 
>
> Key: LANG-1404
> URL: https://issues.apache.org/jira/browse/LANG-1404
> Project: Commons Lang
>  Issue Type: Improvement
>  Components: lang.*
>Reporter: Ruslan Sibgatullin
>Priority: Minor
>
> Right now to convert an Integer to boolean there is either a null check 
> needed:
> {{final Integer value = 1;}}
>  {{if (value != null) {}}
>  {{    if(BooleanUtils.toBoolean(value)) {}}
> {{        // some code}}
>       }
>  {{}}}
> or two methods call:
>  
> {{final Integer value = 1;}}
>  {{final Boolean b = BooleanUtils.toBooleanObject(value);}}
>  {{if (BooleanUtils.toBoolean(b)) {}}
>  {{    // some code}}
>  {{}}}
> Some code-sugar is added with the help of method that accepts Integer and 
> returns boolean:
> {{final Integer value = 1;}}
>  {{if (BooleanUtils.toBoolean(value)) {}}
>  \{{     // some code}}
>  {{}}}
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Updated] (LANG-1404) BooleanUtils.toBoolean(Integer) method added

2018-07-12 Thread Ruslan Sibgatullin (JIRA)


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

Ruslan Sibgatullin updated LANG-1404:
-
Description: 
Right now to convert an Integer to boolean there is either a null check needed:

{{final Integer value = 1;}}
 {{if (value != null) {}}
 {{    if(BooleanUtils.toBoolean(value)) {}}

{{        // some code}}

      }
 {{}}}

or two methods call:

 

{{final Integer value = 1;}}
 {{final Boolean b = BooleanUtils.toBooleanObject(value);}}
 {{if (BooleanUtils.toBoolean(b)) {}}
 {{    // some code}}
 {{}}}

Some code-sugar is added with the help of method that accepts Integer and 
returns boolean:

{{final Integer value = 1;}}
 {{if (BooleanUtils.toBoolean(value)) {}}
      // some code
 {{}}}

 

  was:
Right now to convert an Integer to boolean there is either a null check needed:

{{final Integer value = 1;}}
 {{if (value != null) {}}
 {{    if(BooleanUtils.toBoolean(value)) {}}

{{        // some code}}

      }
 {{}}}

or two methods call:

 

{{final Integer value = 1;}}
 {{final Boolean b = BooleanUtils.toBooleanObject(value);}}
 {{if (BooleanUtils.toBoolean(b)) {}}
 {{    // some code}}
 {{}}}

Some code-sugar is added with the help of method that accepts Integer and 
returns boolean:

{{final Integer value = 1;}}
 {{if (BooleanUtils.toBoolean(value)) {}}
 \{{     // some code}}
 {{}}}

 


> BooleanUtils.toBoolean(Integer) method added
> 
>
> Key: LANG-1404
> URL: https://issues.apache.org/jira/browse/LANG-1404
> Project: Commons Lang
>  Issue Type: Improvement
>  Components: lang.*
>Reporter: Ruslan Sibgatullin
>Priority: Minor
>
> Right now to convert an Integer to boolean there is either a null check 
> needed:
> {{final Integer value = 1;}}
>  {{if (value != null) {}}
>  {{    if(BooleanUtils.toBoolean(value)) {}}
> {{        // some code}}
>       }
>  {{}}}
> or two methods call:
>  
> {{final Integer value = 1;}}
>  {{final Boolean b = BooleanUtils.toBooleanObject(value);}}
>  {{if (BooleanUtils.toBoolean(b)) {}}
>  {{    // some code}}
>  {{}}}
> Some code-sugar is added with the help of method that accepts Integer and 
> returns boolean:
> {{final Integer value = 1;}}
>  {{if (BooleanUtils.toBoolean(value)) {}}
>       // some code
>  {{}}}
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Created] (LANG-1404) BooleanUtils.toBoolean(Integer) method added

2018-07-12 Thread Ruslan Sibgatullin (JIRA)
Ruslan Sibgatullin created LANG-1404:


 Summary: BooleanUtils.toBoolean(Integer) method added
 Key: LANG-1404
 URL: https://issues.apache.org/jira/browse/LANG-1404
 Project: Commons Lang
  Issue Type: Improvement
  Components: lang.*
Reporter: Ruslan Sibgatullin


Right now to convert an Integer to boolean there is either a null check needed:

{{final Integer value = 1;}}
{{if (value != null) {}}
{{    if(BooleanUtils.toBoolean(value)) {}}

{{        // some code}}

{{    }}}
{{}}}

or two methods call:

 

{{final Integer value = 1;}}
{{final Boolean b = BooleanUtils.toBooleanObject(value);}}
{{if (BooleanUtils.toBoolean(b)) {}}
{{    // some code}}
{{}}}

Some code-sugar is added with the help of method that accepts Integer and 
returns boolean:

{{final Integer value = 1;}}
{{if (BooleanUtils.toBoolean(value)) {}}
{{     // some code}}
{{}}}

 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Issue Comment Deleted] (VFS-590) SFTP moveTo operation might fail on permission checks even if the operation itself might succeed

2018-07-12 Thread Zoltan Levardy (JIRA)


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

Zoltan Levardy updated VFS-590:
---
Comment: was deleted

(was: thanks for that update. Is your fix going to be part of v2.3? )

> SFTP moveTo operation might fail on permission checks even if the operation 
> itself might succeed
> 
>
> Key: VFS-590
> URL: https://issues.apache.org/jira/browse/VFS-590
> Project: Commons VFS
>  Issue Type: Bug
>Affects Versions: Nightly Builds
>Reporter: L
>Priority: Major
>
> Continuing with SFTP moveTo, see VFS-588 and VFS-589 for more details.
> The permission checks that VFS performs during moveTo() can result in 
> failure. 
> org.apache.commons.vfs2.provider.AbstractFileObject.moveTo(final FileObject 
> destFile) starts with some checks:
> {code:java}
> @Override
> public void moveTo(final FileObject destFile) throws FileSystemException
> {
> if (canRenameTo(destFile))
> {
> if (!getParent().isWriteable())
> {
> throw new 
> FileSystemException("vfs.provider/rename-parent-read-only.error",
> getName(),
> getParent().getName());
> }
> }
> else
> {
> if (!isWriteable())
> {
> throw new 
> FileSystemException("vfs.provider/rename-read-only.error", getName());
> }
> }
> {code}
> The problem is: isWriteable() might fail or even hang. Performing moveTo 
> without this check might successfully rename the file.
> isWriteable() in case of SFTP can fail if the server disables SSH 
> channelExec. Or if it does not support "id" command.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Issue Comment Deleted] (VFS-590) SFTP moveTo operation might fail on permission checks even if the operation itself might succeed

2018-07-12 Thread Zoltan Levardy (JIRA)


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

Zoltan Levardy updated VFS-590:
---
Comment: was deleted

(was: is this something solvable with jsch and vfs?

What I found with v2.2 that parent and the file itself cannot be determined if 
writable. This is the error what got, however the both the file and parent 
folder is writable (777), and that must be enough for a rename operation.)

> SFTP moveTo operation might fail on permission checks even if the operation 
> itself might succeed
> 
>
> Key: VFS-590
> URL: https://issues.apache.org/jira/browse/VFS-590
> Project: Commons VFS
>  Issue Type: Bug
>Affects Versions: Nightly Builds
>Reporter: L
>Priority: Major
>
> Continuing with SFTP moveTo, see VFS-588 and VFS-589 for more details.
> The permission checks that VFS performs during moveTo() can result in 
> failure. 
> org.apache.commons.vfs2.provider.AbstractFileObject.moveTo(final FileObject 
> destFile) starts with some checks:
> {code:java}
> @Override
> public void moveTo(final FileObject destFile) throws FileSystemException
> {
> if (canRenameTo(destFile))
> {
> if (!getParent().isWriteable())
> {
> throw new 
> FileSystemException("vfs.provider/rename-parent-read-only.error",
> getName(),
> getParent().getName());
> }
> }
> else
> {
> if (!isWriteable())
> {
> throw new 
> FileSystemException("vfs.provider/rename-read-only.error", getName());
> }
> }
> {code}
> The problem is: isWriteable() might fail or even hang. Performing moveTo 
> without this check might successfully rename the file.
> isWriteable() in case of SFTP can fail if the server disables SSH 
> channelExec. Or if it does not support "id" command.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Issue Comment Deleted] (VFS-590) SFTP moveTo operation might fail on permission checks even if the operation itself might succeed

2018-07-12 Thread Zoltan Levardy (JIRA)


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

Zoltan Levardy updated VFS-590:
---
Comment: was deleted

(was: thanks Gary. I hoped there is a patch as mentioned, and no development on 
this part at least 6 month. I have piece of old code, what was working fine on 
old vfs, and no way to get it done with vfs2. There is always a point when 
needed to leave things to go. In my case vfs2 drooped, jsch code to replace, 
less elegant, but do the job. It is no reason to wait for vfs2 miracle to come.)

> SFTP moveTo operation might fail on permission checks even if the operation 
> itself might succeed
> 
>
> Key: VFS-590
> URL: https://issues.apache.org/jira/browse/VFS-590
> Project: Commons VFS
>  Issue Type: Bug
>Affects Versions: Nightly Builds
>Reporter: L
>Priority: Major
>
> Continuing with SFTP moveTo, see VFS-588 and VFS-589 for more details.
> The permission checks that VFS performs during moveTo() can result in 
> failure. 
> org.apache.commons.vfs2.provider.AbstractFileObject.moveTo(final FileObject 
> destFile) starts with some checks:
> {code:java}
> @Override
> public void moveTo(final FileObject destFile) throws FileSystemException
> {
> if (canRenameTo(destFile))
> {
> if (!getParent().isWriteable())
> {
> throw new 
> FileSystemException("vfs.provider/rename-parent-read-only.error",
> getName(),
> getParent().getName());
> }
> }
> else
> {
> if (!isWriteable())
> {
> throw new 
> FileSystemException("vfs.provider/rename-read-only.error", getName());
> }
> }
> {code}
> The problem is: isWriteable() might fail or even hang. Performing moveTo 
> without this check might successfully rename the file.
> isWriteable() in case of SFTP can fail if the server disables SSH 
> channelExec. Or if it does not support "id" command.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Issue Comment Deleted] (VFS-590) SFTP moveTo operation might fail on permission checks even if the operation itself might succeed

2018-07-12 Thread Zoltan Levardy (JIRA)


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

Zoltan Levardy updated VFS-590:
---
Comment: was deleted

(was: long time, still issue still live. Can you please sahare your patch code 
with me? (anyway I need to wipe vfs2 from our projects, as told me) thanks)

> SFTP moveTo operation might fail on permission checks even if the operation 
> itself might succeed
> 
>
> Key: VFS-590
> URL: https://issues.apache.org/jira/browse/VFS-590
> Project: Commons VFS
>  Issue Type: Bug
>Affects Versions: Nightly Builds
>Reporter: L
>Priority: Major
>
> Continuing with SFTP moveTo, see VFS-588 and VFS-589 for more details.
> The permission checks that VFS performs during moveTo() can result in 
> failure. 
> org.apache.commons.vfs2.provider.AbstractFileObject.moveTo(final FileObject 
> destFile) starts with some checks:
> {code:java}
> @Override
> public void moveTo(final FileObject destFile) throws FileSystemException
> {
> if (canRenameTo(destFile))
> {
> if (!getParent().isWriteable())
> {
> throw new 
> FileSystemException("vfs.provider/rename-parent-read-only.error",
> getName(),
> getParent().getName());
> }
> }
> else
> {
> if (!isWriteable())
> {
> throw new 
> FileSystemException("vfs.provider/rename-read-only.error", getName());
> }
> }
> {code}
> The problem is: isWriteable() might fail or even hang. Performing moveTo 
> without this check might successfully rename the file.
> isWriteable() in case of SFTP can fail if the server disables SSH 
> channelExec. Or if it does not support "id" command.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (VFS-590) SFTP moveTo operation might fail on permission checks even if the operation itself might succeed

2018-07-12 Thread Gary Gregory (JIRA)


[ 
https://issues.apache.org/jira/browse/VFS-590?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16541829#comment-16541829
 ] 

Gary Gregory commented on VFS-590:
--

We are volunteers here at Apache with jobs, responsibilities, and so on; so 
unless you are willing to help out by providing a patch preferably with a test, 
then yes, you might as well wish for a miracle ;)

> SFTP moveTo operation might fail on permission checks even if the operation 
> itself might succeed
> 
>
> Key: VFS-590
> URL: https://issues.apache.org/jira/browse/VFS-590
> Project: Commons VFS
>  Issue Type: Bug
>Affects Versions: Nightly Builds
>Reporter: L
>Priority: Major
>
> Continuing with SFTP moveTo, see VFS-588 and VFS-589 for more details.
> The permission checks that VFS performs during moveTo() can result in 
> failure. 
> org.apache.commons.vfs2.provider.AbstractFileObject.moveTo(final FileObject 
> destFile) starts with some checks:
> {code:java}
> @Override
> public void moveTo(final FileObject destFile) throws FileSystemException
> {
> if (canRenameTo(destFile))
> {
> if (!getParent().isWriteable())
> {
> throw new 
> FileSystemException("vfs.provider/rename-parent-read-only.error",
> getName(),
> getParent().getName());
> }
> }
> else
> {
> if (!isWriteable())
> {
> throw new 
> FileSystemException("vfs.provider/rename-read-only.error", getName());
> }
> }
> {code}
> The problem is: isWriteable() might fail or even hang. Performing moveTo 
> without this check might successfully rename the file.
> isWriteable() in case of SFTP can fail if the server disables SSH 
> channelExec. Or if it does not support "id" command.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (VFS-590) SFTP moveTo operation might fail on permission checks even if the operation itself might succeed

2018-07-12 Thread Zoltan Levardy (JIRA)


[ 
https://issues.apache.org/jira/browse/VFS-590?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16541822#comment-16541822
 ] 

Zoltan Levardy commented on VFS-590:


thanks Gary. I hoped there is a patch as mentioned, and no development on this 
part at least 6 month. I have piece of old code, what was working fine on old 
vfs, and no way to get it done with vfs2. There is always a point when needed 
to leave things to go. In my case vfs2 drooped, jsch code to replace, less 
elegant, but do the job. It is no reason to wait for vfs2 miracle to come.

> SFTP moveTo operation might fail on permission checks even if the operation 
> itself might succeed
> 
>
> Key: VFS-590
> URL: https://issues.apache.org/jira/browse/VFS-590
> Project: Commons VFS
>  Issue Type: Bug
>Affects Versions: Nightly Builds
>Reporter: L
>Priority: Major
>
> Continuing with SFTP moveTo, see VFS-588 and VFS-589 for more details.
> The permission checks that VFS performs during moveTo() can result in 
> failure. 
> org.apache.commons.vfs2.provider.AbstractFileObject.moveTo(final FileObject 
> destFile) starts with some checks:
> {code:java}
> @Override
> public void moveTo(final FileObject destFile) throws FileSystemException
> {
> if (canRenameTo(destFile))
> {
> if (!getParent().isWriteable())
> {
> throw new 
> FileSystemException("vfs.provider/rename-parent-read-only.error",
> getName(),
> getParent().getName());
> }
> }
> else
> {
> if (!isWriteable())
> {
> throw new 
> FileSystemException("vfs.provider/rename-read-only.error", getName());
> }
> }
> {code}
> The problem is: isWriteable() might fail or even hang. Performing moveTo 
> without this check might successfully rename the file.
> isWriteable() in case of SFTP can fail if the server disables SSH 
> channelExec. Or if it does not support "id" command.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[GitHub] commons-lang issue #299: Add module-info for Java 9

2018-07-12 Thread jodastephen
Github user jodastephen commented on the issue:

https://github.com/apache/commons-lang/pull/299
  
Its not just compiling, there are issues at runtime still AFAIK, especially 
with Java EE and older bytecode libraries.


---


[jira] [Commented] (COMPRESS-459) CPIO fails decoding multibyte name entries

2018-07-12 Thread Jens Reimann (JIRA)


[ 
https://issues.apache.org/jira/browse/COMPRESS-459?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16541742#comment-16541742
 ] 

Jens Reimann commented on COMPRESS-459:
---

Thanks for taking care of this.

Is there any chance for a soon-ish 1.17.1 version?

> CPIO fails decoding multibyte name entries
> --
>
> Key: COMPRESS-459
> URL: https://issues.apache.org/jira/browse/COMPRESS-459
> Project: Commons Compress
>  Issue Type: Bug
>  Components: Archivers
>Affects Versions: 1.9, 1.17
>Reporter: Jens Reimann
>Priority: Major
>  Labels: patch-available
> Fix For: 1.18
>
>
> Having a CPIO archive in (e.g. UTF-8) mode and having a name entry with a 
> name containing multi-byte characters the decoder fails.
> The problem IMHO is the "getHeaderPadCount" method, which assumes a single 
> byte per character:
>  
> {code:java}
>     public int getHeaderPadCount(){
>     if (this.alignmentBoundary == 0) { return 0; }
>     int size = this.headerSize + 1;  // Name has terminating null
>     if (name != null) {
>     size += name.length();
>     }
>     final int remain = size % this.alignmentBoundary;
>     if (remain > 0){
>     return this.alignmentBoundary - remain;
>     }
>     return 0;
>     }
> {code}
> However this may (or may not) be true for UTF-8.
>  
> Also it wouldn't be enough to call "String#getBytes(…)" as this might already 
> transform the underlying bytes.
> The proper solution would be to provide the name size, as read from the CPIO 
> stream, and pass it to the entry.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Updated] (COLLECTIONS-551) Move Iterable related methods from CollectionUtils to IterableUtils

2018-07-12 Thread Gary Gregory (JIRA)


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

Gary Gregory updated COLLECTIONS-551:
-
Fix Version/s: (was: 4.2)
   4.2.1

> Move Iterable related methods from CollectionUtils to IterableUtils
> ---
>
> Key: COLLECTIONS-551
> URL: https://issues.apache.org/jira/browse/COLLECTIONS-551
> Project: Commons Collections
>  Issue Type: Improvement
>Affects Versions: 4.0
>Reporter: Thomas Neidhart
>Priority: Major
> Fix For: 5.0, 4.2.1
>
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Updated] (COLLECTIONS-542) AbstractHashedMap should not extend AbstractMap anymore

2018-07-12 Thread Gary Gregory (JIRA)


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

Gary Gregory updated COLLECTIONS-542:
-
Fix Version/s: (was: 4.2)
   4.2.1

> AbstractHashedMap should not extend AbstractMap anymore
> ---
>
> Key: COLLECTIONS-542
> URL: https://issues.apache.org/jira/browse/COLLECTIONS-542
> Project: Commons Collections
>  Issue Type: Task
>Affects Versions: 4.0
>Reporter: Thomas Neidhart
>Priority: Minor
> Fix For: 5.0, 4.2.1
>
>
> As described in the javadoc of AbstractHashedMap, the inheritance of 
> AbstractMap should have been removed in the 4.0 release.
> This has been forgotten. Removal of the inheritance does not seem to be 
> possible for the 4.x branch, so we should at least correct the javadoc.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[GitHub] commons-lang issue #299: Add module-info for Java 9

2018-07-12 Thread johnou
Github user johnou commented on the issue:

https://github.com/apache/commons-lang/pull/299
  
@jodastephen have you checked out https://github.com/moditect/moditect ? 

Moditect uses Objweb-ASM to compile the module-info.class which means you 
can support Java 1.7 / 1.8 for Android.


---


[GitHub] commons-lang issue #299: Add module-info for Java 9

2018-07-12 Thread jodastephen
Github user jodastephen commented on the issue:

https://github.com/apache/commons-lang/pull/299
  
Adding `module-info` causes some older/Android projects to fail as they 
can't handle the class format. So, projects are left with the choice of moving 
forwards or breaking these older/Android projects.

This issue is also tied up in the need to modernise the commons parent 
pom.xml for Java 9 and later.


---


[jira] [Commented] (VFS-590) SFTP moveTo operation might fail on permission checks even if the operation itself might succeed

2018-07-12 Thread Gary Gregory (JIRA)


[ 
https://issues.apache.org/jira/browse/VFS-590?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16541526#comment-16541526
 ] 

Gary Gregory commented on VFS-590:
--

Feel free to provide a PR. A test is welcome as well.

> SFTP moveTo operation might fail on permission checks even if the operation 
> itself might succeed
> 
>
> Key: VFS-590
> URL: https://issues.apache.org/jira/browse/VFS-590
> Project: Commons VFS
>  Issue Type: Bug
>Affects Versions: Nightly Builds
>Reporter: L
>Priority: Major
>
> Continuing with SFTP moveTo, see VFS-588 and VFS-589 for more details.
> The permission checks that VFS performs during moveTo() can result in 
> failure. 
> org.apache.commons.vfs2.provider.AbstractFileObject.moveTo(final FileObject 
> destFile) starts with some checks:
> {code:java}
> @Override
> public void moveTo(final FileObject destFile) throws FileSystemException
> {
> if (canRenameTo(destFile))
> {
> if (!getParent().isWriteable())
> {
> throw new 
> FileSystemException("vfs.provider/rename-parent-read-only.error",
> getName(),
> getParent().getName());
> }
> }
> else
> {
> if (!isWriteable())
> {
> throw new 
> FileSystemException("vfs.provider/rename-read-only.error", getName());
> }
> }
> {code}
> The problem is: isWriteable() might fail or even hang. Performing moveTo 
> without this check might successfully rename the file.
> isWriteable() in case of SFTP can fail if the server disables SSH 
> channelExec. Or if it does not support "id" command.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (VFS-590) SFTP moveTo operation might fail on permission checks even if the operation itself might succeed

2018-07-12 Thread Jussi Prevost (JIRA)


[ 
https://issues.apache.org/jira/browse/VFS-590?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16541427#comment-16541427
 ] 

Jussi Prevost commented on VFS-590:
---


Besten Dank für Ihre Email. Ich bin bis und mit 20. Juli 2018 abwesend. Ihre 
Email wird in dieser Zeit weder gelesen noch weitergeleitet.

Freundliche Grüsse
Jussi Prevost

Löwenfels Partner AG  I  Maihofstrasse 1 I  6004 Luzern
Telefon  +41 41 418 44 00  I  Fax +41 41 418 44 44
jussi.prev...@loewenfels.ch  I  
www.loewenfels.ch


> SFTP moveTo operation might fail on permission checks even if the operation 
> itself might succeed
> 
>
> Key: VFS-590
> URL: https://issues.apache.org/jira/browse/VFS-590
> Project: Commons VFS
>  Issue Type: Bug
>Affects Versions: Nightly Builds
>Reporter: L
>Priority: Major
>
> Continuing with SFTP moveTo, see VFS-588 and VFS-589 for more details.
> The permission checks that VFS performs during moveTo() can result in 
> failure. 
> org.apache.commons.vfs2.provider.AbstractFileObject.moveTo(final FileObject 
> destFile) starts with some checks:
> {code:java}
> @Override
> public void moveTo(final FileObject destFile) throws FileSystemException
> {
> if (canRenameTo(destFile))
> {
> if (!getParent().isWriteable())
> {
> throw new 
> FileSystemException("vfs.provider/rename-parent-read-only.error",
> getName(),
> getParent().getName());
> }
> }
> else
> {
> if (!isWriteable())
> {
> throw new 
> FileSystemException("vfs.provider/rename-read-only.error", getName());
> }
> }
> {code}
> The problem is: isWriteable() might fail or even hang. Performing moveTo 
> without this check might successfully rename the file.
> isWriteable() in case of SFTP can fail if the server disables SSH 
> channelExec. Or if it does not support "id" command.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (VFS-590) SFTP moveTo operation might fail on permission checks even if the operation itself might succeed

2018-07-12 Thread Zoltan Levardy (JIRA)


[ 
https://issues.apache.org/jira/browse/VFS-590?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16541424#comment-16541424
 ] 

Zoltan Levardy commented on VFS-590:


long time, still issue still live. Can you please sahare your patch code with 
me? (anyway I need to wipe vfs2 from our projects, as told me) thanks

> SFTP moveTo operation might fail on permission checks even if the operation 
> itself might succeed
> 
>
> Key: VFS-590
> URL: https://issues.apache.org/jira/browse/VFS-590
> Project: Commons VFS
>  Issue Type: Bug
>Affects Versions: Nightly Builds
>Reporter: L
>Priority: Major
>
> Continuing with SFTP moveTo, see VFS-588 and VFS-589 for more details.
> The permission checks that VFS performs during moveTo() can result in 
> failure. 
> org.apache.commons.vfs2.provider.AbstractFileObject.moveTo(final FileObject 
> destFile) starts with some checks:
> {code:java}
> @Override
> public void moveTo(final FileObject destFile) throws FileSystemException
> {
> if (canRenameTo(destFile))
> {
> if (!getParent().isWriteable())
> {
> throw new 
> FileSystemException("vfs.provider/rename-parent-read-only.error",
> getName(),
> getParent().getName());
> }
> }
> else
> {
> if (!isWriteable())
> {
> throw new 
> FileSystemException("vfs.provider/rename-read-only.error", getName());
> }
> }
> {code}
> The problem is: isWriteable() might fail or even hang. Performing moveTo 
> without this check might successfully rename the file.
> isWriteable() in case of SFTP can fail if the server disables SSH 
> channelExec. Or if it does not support "id" command.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)