tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Thomas <ma...@apache.org>
Subject Re: svn commit: r1509143 - in /tomcat/tc7.0.x/trunk: java/org/apache/catalina/ha/deploy/FileMessageFactory.java webapps/docs/changelog.xml
Date Thu, 01 Aug 2013 09:49:57 GMT
On 01/08/2013 11:27, Martin Grigorov wrote:
> Hi,
> 
> 
> On Thu, Aug 1, 2013 at 11:25 AM, <kfujino@apache.org> wrote:
> 
>> Author: kfujino
>> Date: Thu Aug  1 09:25:12 2013
>> New Revision: 1509143
>>
>> URL: http://svn.apache.org/r1509143
>> Log:
>> Fix NPE in FileMessageFactory.main when specify empty file as arguments.
>>
>> Modified:
>>
>> tomcat/tc7.0.x/trunk/java/org/apache/catalina/ha/deploy/FileMessageFactory.java
>>     tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml
>>
>> Modified:
>> tomcat/tc7.0.x/trunk/java/org/apache/catalina/ha/deploy/FileMessageFactory.java
>> URL:
>> http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/ha/deploy/FileMessageFactory.java?rev=1509143&r1=1509142&r2=1509143&view=diff
>>
>> ==============================================================================
>> ---
>> tomcat/tc7.0.x/trunk/java/org/apache/catalina/ha/deploy/FileMessageFactory.java
>> (original)
>> +++
>> tomcat/tc7.0.x/trunk/java/org/apache/catalina/ha/deploy/FileMessageFactory.java
>> Thu Aug  1 09:25:12 2013
>> @@ -376,6 +376,10 @@ public class FileMessageFactory {
>>          FileMessageFactory write = getInstance(new File(args[1]), true);
>>          FileMessage msg = new FileMessage(null, args[0], args[0]);
>>          msg = read.readMessage(msg);
>> +        if (msg == null) {
>> +            System.out.println("Empty input file : " + args[0]);
>>
> 
> Do you really mean "System.out" here ?
> Usually loggers are used.

Yes, I am sure he does. This is a main method, not something that is
called in normal Tomcat usage. It should probably move to the test tree.

>> +            return;
>> +        }
>>          System.out.println("Expecting to write " + msg.getTotalNrOfMsgs()
>>                  + " messages.");
>>
> 
> I see it is used even before.

Yes. Perfectly reasonably.

I'd strongly recommend looking at the source code before commenting on a
commit. The context provided by the diff isn't always the full story.

Mark


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


Mime
View raw message