You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by no...@apache.org on 2006/10/07 19:58:05 UTC
svn commit: r453971 - in
/james/server/trunk/src/java/org/apache/james/context:
AvalonContextUtilities.java AvalonFileSystem.java
Author: norman
Date: Sat Oct 7 10:58:04 2006
New Revision: 453971
URL: http://svn.apache.org/viewvc?view=rev&rev=453971
Log:
Change the throwed Exception to the "right" one..
Modified:
james/server/trunk/src/java/org/apache/james/context/AvalonContextUtilities.java
james/server/trunk/src/java/org/apache/james/context/AvalonFileSystem.java
Modified: james/server/trunk/src/java/org/apache/james/context/AvalonContextUtilities.java
URL: http://svn.apache.org/viewvc/james/server/trunk/src/java/org/apache/james/context/AvalonContextUtilities.java?view=diff&rev=453971&r1=453970&r2=453971
==============================================================================
--- james/server/trunk/src/java/org/apache/james/context/AvalonContextUtilities.java (original)
+++ james/server/trunk/src/java/org/apache/james/context/AvalonContextUtilities.java Sat Oct 7 10:58:04 2006
@@ -55,7 +55,7 @@
* application home, unless it begins with a slash. In
* the latter case the file location is evaluated relative
* to the underlying file system root.
- *
+ *
* @throws IllegalArgumentException if the arguments are null or the file
* URL is not appropriately formatted.
* @throws ContextException if the underlying context generates a
@@ -63,8 +63,7 @@
* not correct, or if an IOException is generated
* while accessing the file.
*/
- public static File getFile(Context context, String fileURL)
- throws Exception {
+ public static File getFile(Context context, String fileURL) throws ContextException {
if ((context == null) || (fileURL == null)) {
throw new IllegalArgumentException("The getFile method doesn't allow null arguments.");
}
Modified: james/server/trunk/src/java/org/apache/james/context/AvalonFileSystem.java
URL: http://svn.apache.org/viewvc/james/server/trunk/src/java/org/apache/james/context/AvalonFileSystem.java?view=diff&rev=453971&r1=453970&r2=453971
==============================================================================
--- james/server/trunk/src/java/org/apache/james/context/AvalonFileSystem.java (original)
+++ james/server/trunk/src/java/org/apache/james/context/AvalonFileSystem.java Sat Oct 7 10:58:04 2006
@@ -47,8 +47,6 @@
return AvalonContextUtilities.getFile(context, fileURL);
} catch (ContextException e) {
throw new FileNotFoundException("Context exception: "+e.getMessage());
- } catch (Exception e) {
- throw new FileNotFoundException(e.getMessage());
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org
Re: svn commit: r453971 - in /james/server/trunk/src/java/org/apache/james/context:
AvalonContextUtilities.java AvalonFileSystem.java
Posted by Stefano Bagnara <ap...@bago.org>.
norman@apache.org wrote:
> Author: norman
> Date: Sat Oct 7 10:58:04 2006
> New Revision: 453971
>
> URL: http://svn.apache.org/viewvc?view=rev&rev=453971
> Log:
> Change the throwed Exception to the "right" one..
Uh? I did the refactoring to remove
Context/Contextualize/ContextException from the
visibilities/dependencies of other components: thet shouldn't get the
ContextException.
ContextException is not the right one but simply what the
AvalonContextUtilities throw.
I'm -1 to this patch.
At most we could introduce a FileSystemException but I think we can live
with the FileNotFoundException as we are simply asking for a File.
Stefano
> Modified:
> james/server/trunk/src/java/org/apache/james/context/AvalonContextUtilities.java
> james/server/trunk/src/java/org/apache/james/context/AvalonFileSystem.java
>
> Modified: james/server/trunk/src/java/org/apache/james/context/AvalonContextUtilities.java
> URL: http://svn.apache.org/viewvc/james/server/trunk/src/java/org/apache/james/context/AvalonContextUtilities.java?view=diff&rev=453971&r1=453970&r2=453971
> ==============================================================================
> --- james/server/trunk/src/java/org/apache/james/context/AvalonContextUtilities.java (original)
> +++ james/server/trunk/src/java/org/apache/james/context/AvalonContextUtilities.java Sat Oct 7 10:58:04 2006
> @@ -55,7 +55,7 @@
> * application home, unless it begins with a slash. In
> * the latter case the file location is evaluated relative
> * to the underlying file system root.
> - *
> + *
> * @throws IllegalArgumentException if the arguments are null or the file
> * URL is not appropriately formatted.
> * @throws ContextException if the underlying context generates a
> @@ -63,8 +63,7 @@
> * not correct, or if an IOException is generated
> * while accessing the file.
> */
> - public static File getFile(Context context, String fileURL)
> - throws Exception {
> + public static File getFile(Context context, String fileURL) throws ContextException {
> if ((context == null) || (fileURL == null)) {
> throw new IllegalArgumentException("The getFile method doesn't allow null arguments.");
> }
>
> Modified: james/server/trunk/src/java/org/apache/james/context/AvalonFileSystem.java
> URL: http://svn.apache.org/viewvc/james/server/trunk/src/java/org/apache/james/context/AvalonFileSystem.java?view=diff&rev=453971&r1=453970&r2=453971
> ==============================================================================
> --- james/server/trunk/src/java/org/apache/james/context/AvalonFileSystem.java (original)
> +++ james/server/trunk/src/java/org/apache/james/context/AvalonFileSystem.java Sat Oct 7 10:58:04 2006
> @@ -47,8 +47,6 @@
> return AvalonContextUtilities.getFile(context, fileURL);
> } catch (ContextException e) {
> throw new FileNotFoundException("Context exception: "+e.getMessage());
> - } catch (Exception e) {
> - throw new FileNotFoundException(e.getMessage());
> }
> }
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
> For additional commands, e-mail: server-dev-help@james.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org
Re: svn commit: r453971 - in /james/server/trunk/src/java/org/apache/james/context:
AvalonContextUtilities.java AvalonFileSystem.java
Posted by Stefano Bagnara <ap...@bago.org>.
Sorry, I think I misunderstood your patch reading the diff.
I now looked at it much better and I see the change.
The main difference is that previously an illegal path was encapsulated
in a FileNotFoundException while after your patch it passes as an
IllegalArgumentException.
Not sure if this can create more or less problems: I don't have the time
to review all the callers to understand wether this improve or not the
current logging/behaviour, but maybe I would prefer to switch to the old
behaviour, maybe throwing a ContextException from AvalonContextUtilities
instead of the illegalArgumentException (so that it get cought by
AvalonFileSystem).
WDYT?
Stefano
Norman Maurer wrote:
> i thought we always use the AvolonFileSystem so it throw only
> FileNotFoundException... Im wrong ?
>
> bye
> Norman
>
> Stefano Bagnara schrieb:
>> norman@apache.org wrote:
>>> Author: norman
>>> Date: Sat Oct 7 10:58:04 2006
>>> New Revision: 453971
>>>
>>> URL: http://svn.apache.org/viewvc?view=rev&rev=453971
>>> Log:
>>> Change the throwed Exception to the "right" one..
>>
>> Uh? I did the refactoring to remove
>> Context/Contextualize/ContextException from the
>> visibilities/dependencies of other components: thet shouldn't get the
>> ContextException.
>>
>> ContextException is not the right one but simply what the
>> AvalonContextUtilities throw.
>>
>> I'm -1 to this patch.
>>
>> At most we could introduce a FileSystemException but I think we can
>> live with the FileNotFoundException as we are simply asking for a File.
>>
>> Stefano
>>
>>> Modified:
>>>
>>> james/server/trunk/src/java/org/apache/james/context/AvalonContextUtilities.java
>>>
>>>
>>> james/server/trunk/src/java/org/apache/james/context/AvalonFileSystem.java
>>>
>>>
>>> Modified:
>>> james/server/trunk/src/java/org/apache/james/context/AvalonContextUtilities.java
>>>
>>> URL:
>>> http://svn.apache.org/viewvc/james/server/trunk/src/java/org/apache/james/context/AvalonContextUtilities.java?view=diff&rev=453971&r1=453970&r2=453971
>>>
>>> ==============================================================================
>>>
>>> ---
>>> james/server/trunk/src/java/org/apache/james/context/AvalonContextUtilities.java
>>> (original)
>>> +++
>>> james/server/trunk/src/java/org/apache/james/context/AvalonContextUtilities.java
>>> Sat Oct 7 10:58:04 2006
>>> @@ -55,7 +55,7 @@
>>> * application home, unless it begins with a
>>> slash. In
>>> * the latter case the file location is evaluated
>>> relative
>>> * to the underlying file system root.
>>> - *
>>> + * * @throws IllegalArgumentException if
>>> the arguments are null or the file
>>> * URL is not appropriately
>>> formatted.
>>> * @throws ContextException if the underlying context generates a
>>> @@ -63,8 +63,7 @@
>>> * not correct, or if an IOException is
>>> generated
>>> * while accessing the file.
>>> */
>>> - public static File getFile(Context context, String fileURL)
>>> - throws Exception {
>>> + public static File getFile(Context context, String fileURL)
>>> throws ContextException {
>>> if ((context == null) || (fileURL == null)) {
>>> throw new IllegalArgumentException("The getFile method
>>> doesn't allow null arguments.");
>>> }
>>>
>>> Modified:
>>> james/server/trunk/src/java/org/apache/james/context/AvalonFileSystem.java
>>>
>>> URL:
>>> http://svn.apache.org/viewvc/james/server/trunk/src/java/org/apache/james/context/AvalonFileSystem.java?view=diff&rev=453971&r1=453970&r2=453971
>>>
>>> ==============================================================================
>>>
>>> ---
>>> james/server/trunk/src/java/org/apache/james/context/AvalonFileSystem.java
>>> (original)
>>> +++
>>> james/server/trunk/src/java/org/apache/james/context/AvalonFileSystem.java
>>> Sat Oct 7 10:58:04 2006
>>> @@ -47,8 +47,6 @@
>>> return AvalonContextUtilities.getFile(context, fileURL);
>>> } catch (ContextException e) {
>>> throw new FileNotFoundException("Context exception:
>>> "+e.getMessage());
>>> - } catch (Exception e) {
>>> - throw new FileNotFoundException(e.getMessage());
>>> }
>>> }
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
>>> For additional commands, e-mail: server-dev-help@james.apache.org
>>>
>>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
>> For additional commands, e-mail: server-dev-help@james.apache.org
>>
>> !EXCUBATOR:1,452806bc53073488419935!
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
> For additional commands, e-mail: server-dev-help@james.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org
Re: svn commit: r453971 - in /james/server/trunk/src/java/org/apache/james/context:
AvalonContextUtilities.java AvalonFileSystem.java
Posted by Stefano Bagnara <ap...@bago.org>.
Norman Maurer wrote:
> I still think you missunderstood it ;-) I only change the "throws
> Exception" to "throws ContextException"..
> Thats all ..
You also changed this:
> ---
> james/server/trunk/src/java/org/apache/james/context/AvalonFileSystem.java
> (original)
> +++
> james/server/trunk/src/java/org/apache/james/context/AvalonFileSystem.java
> Sat Oct 7 10:58:04 2006
> @@ -47,8 +47,6 @@
> return AvalonContextUtilities.getFile(context, fileURL);
> } catch (ContextException e) {
> throw new FileNotFoundException("Context exception:
> "+e.getMessage());
> - } catch (Exception e) {
> - throw new FileNotFoundException(e.getMessage());
> }
> }
And the catch(Exception e) is the block that cought the
IllegalArgumentException that now is no more cought: did I understand?
Stefano
---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org
Re: svn commit: r453971 - in /james/server/trunk/src/java/org/apache/james/context:
AvalonContextUtilities.java AvalonFileSystem.java
Posted by Norman Maurer <nm...@byteaction.de>.
Wow.. you are right.... We should catch this with the
IllegalArgumentException ..
I not like to use catch (Exception) ..
So i think the patch is not complete like it is..
bye
Norman
Stefano Bagnara schrieb:
> Norman Maurer wrote:
>> I still think you missunderstood it ;-) I only change the "throws
>> Exception" to "throws ContextException"..
>> Thats all ..
>
> You also changed this:
>
>> ---
>> james/server/trunk/src/java/org/apache/james/context/AvalonFileSystem.java
>> (original)
>> +++
>> james/server/trunk/src/java/org/apache/james/context/AvalonFileSystem.java
>> Sat Oct 7 10:58:04 2006
>> @@ -47,8 +47,6 @@
>> return AvalonContextUtilities.getFile(context, fileURL);
>> } catch (ContextException e) {
>> throw new FileNotFoundException("Context exception:
>> "+e.getMessage());
>> - } catch (Exception e) {
>> - throw new FileNotFoundException(e.getMessage());
>> }
>> }
>
>
> And the catch(Exception e) is the block that cought the
> IllegalArgumentException that now is no more cought: did I understand?
>
> Stefano
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
> For additional commands, e-mail: server-dev-help@james.apache.org
>
> !EXCUBATOR:1,45281b5a53071024755060!
---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org
Re: svn commit: r453971 - in /james/server/trunk/src/java/org/apache/james/context:
AvalonContextUtilities.java AvalonFileSystem.java
Posted by Norman Maurer <nm...@byteaction.de>.
I still think you missunderstood it ;-) I only change the "throws
Exception" to "throws ContextException"..
Thats all ..
bye
Norman
Stefano Bagnara schrieb:
> Sorry, I think I misunderstood your patch reading the diff.
> I now looked at it much better and I see the change.
>
> The main difference is that previously an illegal path was
> encapsulated in a FileNotFoundException while after your patch it
> passes as an IllegalArgumentException.
>
> Not sure if this can create more or less problems: I don't have the
> time to review all the callers to understand wether this improve or
> not the current logging/behaviour, but maybe I would prefer to switch
> to the old behaviour, maybe throwing a ContextException from
> AvalonContextUtilities instead of the illegalArgumentException (so
> that it get cought by AvalonFileSystem).
>
> WDYT?
>
> Stefano
>
> Norman Maurer wrote:
>> i thought we always use the AvolonFileSystem so it throw only
>> FileNotFoundException... Im wrong ?
>>
>> bye
>> Norman
>>
>> Stefano Bagnara schrieb:
>>> norman@apache.org wrote:
>>>> Author: norman
>>>> Date: Sat Oct 7 10:58:04 2006
>>>> New Revision: 453971
>>>>
>>>> URL: http://svn.apache.org/viewvc?view=rev&rev=453971
>>>> Log:
>>>> Change the throwed Exception to the "right" one..
>>>
>>> Uh? I did the refactoring to remove
>>> Context/Contextualize/ContextException from the
>>> visibilities/dependencies of other components: thet shouldn't get
>>> the ContextException.
>>>
>>> ContextException is not the right one but simply what the
>>> AvalonContextUtilities throw.
>>>
>>> I'm -1 to this patch.
>>>
>>> At most we could introduce a FileSystemException but I think we can
>>> live with the FileNotFoundException as we are simply asking for a File.
>>>
>>> Stefano
>>>
>>>> Modified:
>>>>
>>>> james/server/trunk/src/java/org/apache/james/context/AvalonContextUtilities.java
>>>>
>>>>
>>>> james/server/trunk/src/java/org/apache/james/context/AvalonFileSystem.java
>>>>
>>>>
>>>> Modified:
>>>> james/server/trunk/src/java/org/apache/james/context/AvalonContextUtilities.java
>>>>
>>>> URL:
>>>> http://svn.apache.org/viewvc/james/server/trunk/src/java/org/apache/james/context/AvalonContextUtilities.java?view=diff&rev=453971&r1=453970&r2=453971
>>>>
>>>> ==============================================================================
>>>>
>>>> ---
>>>> james/server/trunk/src/java/org/apache/james/context/AvalonContextUtilities.java
>>>> (original)
>>>> +++
>>>> james/server/trunk/src/java/org/apache/james/context/AvalonContextUtilities.java
>>>> Sat Oct 7 10:58:04 2006
>>>> @@ -55,7 +55,7 @@
>>>> * application home, unless it begins with a
>>>> slash. In
>>>> * the latter case the file location is
>>>> evaluated relative
>>>> * to the underlying file system root.
>>>> - *
>>>> + * * @throws IllegalArgumentException if
>>>> the arguments are null or the file
>>>> * URL is not appropriately
>>>> formatted.
>>>> * @throws ContextException if the underlying context generates a
>>>> @@ -63,8 +63,7 @@
>>>> * not correct, or if an IOException
>>>> is generated
>>>> * while accessing the file.
>>>> */
>>>> - public static File getFile(Context context, String fileURL)
>>>> - throws Exception {
>>>> + public static File getFile(Context context, String fileURL)
>>>> throws ContextException {
>>>> if ((context == null) || (fileURL == null)) {
>>>> throw new IllegalArgumentException("The getFile method
>>>> doesn't allow null arguments.");
>>>> }
>>>>
>>>> Modified:
>>>> james/server/trunk/src/java/org/apache/james/context/AvalonFileSystem.java
>>>>
>>>> URL:
>>>> http://svn.apache.org/viewvc/james/server/trunk/src/java/org/apache/james/context/AvalonFileSystem.java?view=diff&rev=453971&r1=453970&r2=453971
>>>>
>>>> ==============================================================================
>>>>
>>>> ---
>>>> james/server/trunk/src/java/org/apache/james/context/AvalonFileSystem.java
>>>> (original)
>>>> +++
>>>> james/server/trunk/src/java/org/apache/james/context/AvalonFileSystem.java
>>>> Sat Oct 7 10:58:04 2006
>>>> @@ -47,8 +47,6 @@
>>>> return AvalonContextUtilities.getFile(context, fileURL);
>>>> } catch (ContextException e) {
>>>> throw new FileNotFoundException("Context exception:
>>>> "+e.getMessage());
>>>> - } catch (Exception e) {
>>>> - throw new FileNotFoundException(e.getMessage());
>>>> }
>>>> }
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
>>>> For additional commands, e-mail: server-dev-help@james.apache.org
>>>>
>>>>
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
>>> For additional commands, e-mail: server-dev-help@james.apache.org
>>>
>>> !EXCUBATOR:1,452806bc53073488419935!
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
>> For additional commands, e-mail: server-dev-help@james.apache.org
>>
>>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
> For additional commands, e-mail: server-dev-help@james.apache.org
>
> !EXCUBATOR:1,4528161153073775518208!
---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org
Re: svn commit: r453971 - in /james/server/trunk/src/java/org/apache/james/context:
AvalonContextUtilities.java AvalonFileSystem.java
Posted by Norman Maurer <nm...@byteaction.de>.
i thought we always use the AvolonFileSystem so it throw only
FileNotFoundException... Im wrong ?
bye
Norman
Stefano Bagnara schrieb:
> norman@apache.org wrote:
>> Author: norman
>> Date: Sat Oct 7 10:58:04 2006
>> New Revision: 453971
>>
>> URL: http://svn.apache.org/viewvc?view=rev&rev=453971
>> Log:
>> Change the throwed Exception to the "right" one..
>
> Uh? I did the refactoring to remove
> Context/Contextualize/ContextException from the
> visibilities/dependencies of other components: thet shouldn't get the
> ContextException.
>
> ContextException is not the right one but simply what the
> AvalonContextUtilities throw.
>
> I'm -1 to this patch.
>
> At most we could introduce a FileSystemException but I think we can
> live with the FileNotFoundException as we are simply asking for a File.
>
> Stefano
>
>> Modified:
>>
>> james/server/trunk/src/java/org/apache/james/context/AvalonContextUtilities.java
>>
>>
>> james/server/trunk/src/java/org/apache/james/context/AvalonFileSystem.java
>>
>>
>> Modified:
>> james/server/trunk/src/java/org/apache/james/context/AvalonContextUtilities.java
>>
>> URL:
>> http://svn.apache.org/viewvc/james/server/trunk/src/java/org/apache/james/context/AvalonContextUtilities.java?view=diff&rev=453971&r1=453970&r2=453971
>>
>> ==============================================================================
>>
>> ---
>> james/server/trunk/src/java/org/apache/james/context/AvalonContextUtilities.java
>> (original)
>> +++
>> james/server/trunk/src/java/org/apache/james/context/AvalonContextUtilities.java
>> Sat Oct 7 10:58:04 2006
>> @@ -55,7 +55,7 @@
>> * application home, unless it begins with a
>> slash. In
>> * the latter case the file location is evaluated
>> relative
>> * to the underlying file system root.
>> - *
>> + * * @throws IllegalArgumentException if
>> the arguments are null or the file
>> * URL is not appropriately
>> formatted.
>> * @throws ContextException if the underlying context generates a
>> @@ -63,8 +63,7 @@
>> * not correct, or if an IOException is
>> generated
>> * while accessing the file.
>> */
>> - public static File getFile(Context context, String fileURL)
>> - throws Exception {
>> + public static File getFile(Context context, String fileURL)
>> throws ContextException {
>> if ((context == null) || (fileURL == null)) {
>> throw new IllegalArgumentException("The getFile method
>> doesn't allow null arguments.");
>> }
>>
>> Modified:
>> james/server/trunk/src/java/org/apache/james/context/AvalonFileSystem.java
>>
>> URL:
>> http://svn.apache.org/viewvc/james/server/trunk/src/java/org/apache/james/context/AvalonFileSystem.java?view=diff&rev=453971&r1=453970&r2=453971
>>
>> ==============================================================================
>>
>> ---
>> james/server/trunk/src/java/org/apache/james/context/AvalonFileSystem.java
>> (original)
>> +++
>> james/server/trunk/src/java/org/apache/james/context/AvalonFileSystem.java
>> Sat Oct 7 10:58:04 2006
>> @@ -47,8 +47,6 @@
>> return AvalonContextUtilities.getFile(context, fileURL);
>> } catch (ContextException e) {
>> throw new FileNotFoundException("Context exception:
>> "+e.getMessage());
>> - } catch (Exception e) {
>> - throw new FileNotFoundException(e.getMessage());
>> }
>> }
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
>> For additional commands, e-mail: server-dev-help@james.apache.org
>>
>>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
> For additional commands, e-mail: server-dev-help@james.apache.org
>
> !EXCUBATOR:1,452806bc53073488419935!
---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org