You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Max Bowsher <ma...@mxtelecom.com> on 2007/03/29 13:41:20 UTC

Re: [vote] Release 2.2-beta-1 of maven-assembly-plugin (Decimal/Octal file modes issue)

John Casey wrote:
> Max: I'm tempted to say that we should look for decimal versions of common
> octal expressions, then prefix the rest with '0' to ensure they're
> interpreted as octal (unless they have 0x in front, that is).
> 
> Is that a decent solution?

I think that it is the best compromise between maintaining the same
behaviour with existing descriptors, and fixing the bug going forward
into the future.


Would this behaviour apply to all modes in the descriptor, or just
<file><fileMode> ? (I'd lean toward the latter).


OOI, why prepend a leading zero, rather than using Integer.parseInt(x,8)
and Integer.parseInt(x,10) as appropriate? I was thinking of something
along the lines of:

HashMap commonModes = new HashMap() {{
  add("


Max.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: [vote] Release 2.2-beta-1 of maven-assembly-plugin (Decimal/Octal file modes issue)

Posted by Max Bowsher <ma...@mxtelecom.com>.
Max Bowsher wrote:
> John Casey wrote:
>> Max: I'm tempted to say that we should look for decimal versions of common
>> octal expressions, then prefix the rest with '0' to ensure they're
>> interpreted as octal (unless they have 0x in front, that is).
>>
>> Is that a decent solution?
> 
> I think that it is the best compromise between maintaining the same
> behaviour with existing descriptors, and fixing the bug going forward
> into the future.
> 
> 
> Would this behaviour apply to all modes in the descriptor, or just
> <file><fileMode> ? (I'd lean toward the latter).
> 
> 
> OOI, why prepend a leading zero, rather than using Integer.parseInt(x,8)
> and Integer.parseInt(x,10) as appropriate? I was thinking of something
> along the lines of:
> 
> HashMap commonModes = new HashMap() {{
>   add("

Oh, grr. I'd really like to know how Thunderbird managed to save a
previous version than was showing when I did save-to-Drafts.

Anyway, I meant:

private static HashMap commonDecimalModes = new HashMap() {{
  add("420");
  add("436");
  add("493");
  add("509");
}}

.....

if ( commonDecimalModes.contains( mode ) )
  return Integer.parseInt( mode, 10 );
else
  return Integer.parseInt( mode, 8 );

Max.




---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org