You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Vadim Gritsenko <va...@reverycodes.com> on 2005/01/19 23:48:37 UTC

Re: svn commit: r125646 - /cocoon/trunk/src/blocks/cron/java/org/apache/cocoon/components/cron/QuartzJobScheduler.java

rgoers@apache.org wrote:
> Author: rgoers
> Date: Wed Jan 19 11:58:55 2005
> New Revision: 125646
> 
> URL: http://svn.apache.org/viewcvs?view=rev&rev=125646
> Log:
> executor attribute was never being set. Fix NPE.
> 
> Modified:
>    cocoon/trunk/src/blocks/cron/java/org/apache/cocoon/components/cron/QuartzJobScheduler.java
> 
> Modified: cocoon/trunk/src/blocks/cron/java/org/apache/cocoon/components/cron/QuartzJobScheduler.java
> Url: http://svn.apache.org/viewcvs/cocoon/trunk/src/blocks/cron/java/org/apache/cocoon/components/cron/QuartzJobScheduler.java?view=diff&rev=125646&p1=cocoon/trunk/src/blocks/cron/java/org/apache/cocoon/components/cron/QuartzJobScheduler.java&r1=125645&p2=cocoon/trunk/src/blocks/cron/java/org/apache/cocoon/components/cron/QuartzJobScheduler.java&r2=125646
> ==============================================================================
> --- cocoon/trunk/src/blocks/cron/java/org/apache/cocoon/components/cron/QuartzJobScheduler.java	(original)
> +++ cocoon/trunk/src/blocks/cron/java/org/apache/cocoon/components/cron/QuartzJobScheduler.java	Wed Jan 19 11:58:55 2005
> @@ -572,7 +572,8 @@
>          jobDataMap.put(DATA_MAP_LOGGER, getLogger());
>          jobDataMap.put(DATA_MAP_CONTEXT, this.context);
>          jobDataMap.put(DATA_MAP_MANAGER, this.manager);
> -        jobDataMap.put(DATA_MAP_RUN_CONCURRENT, concurent? Boolean.TRUE: Boolean.FALSE);
> +        jobDataMap.put(DATA_MAP_RUN_CONCURRENT,
> +            concurent? Boolean.TRUE.booleanValue(): Boolean.FALSE.booleanValue());

Won't it fail later on here?
final Boolean canRunConcurrentlyB = ((Boolean) 
data.get(QuartzJobScheduler.DATA_MAP_RUN_CONCURRENT));


Vadim

Re: svn commit: r125646 - /cocoon/trunk/src/blocks/cron/java/org/apache/cocoon/components/cron/QuartzJobScheduler.java

Posted by Ralph Goers <Ra...@dslextreme.com>.
Vadim Gritsenko wrote:

> rgoers@apache.org wrote:
>
>> Author: rgoers
>> Date: Wed Jan 19 11:58:55 2005
>> New Revision: 125646
>>
>> URL: http://svn.apache.org/viewcvs?view=rev&rev=125646
>> Log:
>> executor attribute was never being set. Fix NPE.
>>
>> Modified:
>>    
>> cocoon/trunk/src/blocks/cron/java/org/apache/cocoon/components/cron/QuartzJobScheduler.java 
>>
>>
>> Modified: 
>> cocoon/trunk/src/blocks/cron/java/org/apache/cocoon/components/cron/QuartzJobScheduler.java 
>>
>> Url: 
>> http://svn.apache.org/viewcvs/cocoon/trunk/src/blocks/cron/java/org/apache/cocoon/components/cron/QuartzJobScheduler.java?view=diff&rev=125646&p1=cocoon/trunk/src/blocks/cron/java/org/apache/cocoon/components/cron/QuartzJobScheduler.java&r1=125645&p2=cocoon/trunk/src/blocks/cron/java/org/apache/cocoon/components/cron/QuartzJobScheduler.java&r2=125646 
>>
>> ============================================================================== 
>>
>> --- 
>> cocoon/trunk/src/blocks/cron/java/org/apache/cocoon/components/cron/QuartzJobScheduler.java    
>> (original)
>> +++ 
>> cocoon/trunk/src/blocks/cron/java/org/apache/cocoon/components/cron/QuartzJobScheduler.java    
>> Wed Jan 19 11:58:55 2005
>> @@ -572,7 +572,8 @@
>>          jobDataMap.put(DATA_MAP_LOGGER, getLogger());
>>          jobDataMap.put(DATA_MAP_CONTEXT, this.context);
>>          jobDataMap.put(DATA_MAP_MANAGER, this.manager);
>> -        jobDataMap.put(DATA_MAP_RUN_CONCURRENT, concurent? 
>> Boolean.TRUE: Boolean.FALSE);
>> +        jobDataMap.put(DATA_MAP_RUN_CONCURRENT,
>> +            concurent? Boolean.TRUE.booleanValue(): 
>> Boolean.FALSE.booleanValue());
>
>
> Won't it fail later on here?
> final Boolean canRunConcurrentlyB = ((Boolean) 
> data.get(QuartzJobScheduler.DATA_MAP_RUN_CONCURRENT));
>
>
> Vadim

Shoot. Looking at it now it should have just been changed to:
  jobDataMap.put(DATA_MAP_RUN_CONCURRENT, concurent);

Ralph

Re: svn commit: r125646 - /cocoon/trunk/src/blocks/cron/java/org/apache/cocoon/components/cron/QuartzJobScheduler.java

Posted by Vadim Gritsenko <va...@reverycodes.com>.
Ralph Goers wrote:
> Ralph Goers wrote:
> 
>> Vadim Gritsenko wrote:
>>
>>> Won't it fail later on here?
>>> final Boolean canRunConcurrentlyB = ((Boolean) 
>>> data.get(QuartzJobScheduler.DATA_MAP_RUN_CONCURRENT));
>>
>>
>> No.  There are multiple versions of the put method. The one that takes 
>> boolean actually creates a Boolean and stores it.  I changed it 
>> because IntelliJ was complaining that it couldn't figure out whether 
>> to use put(Object, Object) or put(String, boolean).  Presumably this 
>> shows up as a warning somewhere during compilation.
> 
> I wondered why I don't see this in my IntelliJ project for 
> BRANCH_2_1_X.  It turns out I have the language level for 2.1.x set to 
> 1.3.  For the trunk project it is set to 5.0.

Then you should (still) be able to do
   (Object) (concurrent? Boolean.TRUE: Boolean.FALSE)
and this should make 1.5 happy, right?


PS I'm not on 1.5 yet.

Vadim

Re: svn commit: r125646 - /cocoon/trunk/src/blocks/cron/java/org/apache/cocoon/components/cron/QuartzJobScheduler.java

Posted by Ralph Goers <Ra...@dslextreme.com>.
Ralph Goers wrote:

> Vadim Gritsenko wrote:
>
>> Won't it fail later on here?
>> final Boolean canRunConcurrentlyB = ((Boolean) 
>> data.get(QuartzJobScheduler.DATA_MAP_RUN_CONCURRENT));
>>
>>
>> Vadim 
>
>
> No.  There are multiple versions of the put method. The one that takes 
> boolean actually creates a Boolean and stores it.  I changed it 
> because IntelliJ was complaining that it couldn't figure out whether 
> to use put(Object, Object) or put(String, boolean).  Presumably this 
> shows up as a warning somewhere during compilation.
>
> Ralph

I wondered why I don't see this in my IntelliJ project for 
BRANCH_2_1_X.  It turns out I have the language level for 2.1.x set to 
1.3.  For the trunk project it is set to 5.0.

Ralph


Re: svn commit: r125646 - /cocoon/trunk/src/blocks/cron/java/org/apache/cocoon/components/cron/QuartzJobScheduler.java

Posted by Ralph Goers <Ra...@dslextreme.com>.
Vadim Gritsenko wrote:

> rgoers@apache.org wrote:
>
>> Author: rgoers
>> Date: Wed Jan 19 11:58:55 2005
>> New Revision: 125646
>>
>> URL: http://svn.apache.org/viewcvs?view=rev&rev=125646
>> Log:
>> executor attribute was never being set. Fix NPE.
>>
>> Modified:
>>    
>> cocoon/trunk/src/blocks/cron/java/org/apache/cocoon/components/cron/QuartzJobScheduler.java 
>>
>>
>> Modified: 
>> cocoon/trunk/src/blocks/cron/java/org/apache/cocoon/components/cron/QuartzJobScheduler.java 
>>
>> Url: 
>> http://svn.apache.org/viewcvs/cocoon/trunk/src/blocks/cron/java/org/apache/cocoon/components/cron/QuartzJobScheduler.java?view=diff&rev=125646&p1=cocoon/trunk/src/blocks/cron/java/org/apache/cocoon/components/cron/QuartzJobScheduler.java&r1=125645&p2=cocoon/trunk/src/blocks/cron/java/org/apache/cocoon/components/cron/QuartzJobScheduler.java&r2=125646 
>>
>> ============================================================================== 
>>
>> --- 
>> cocoon/trunk/src/blocks/cron/java/org/apache/cocoon/components/cron/QuartzJobScheduler.java    
>> (original)
>> +++ 
>> cocoon/trunk/src/blocks/cron/java/org/apache/cocoon/components/cron/QuartzJobScheduler.java    
>> Wed Jan 19 11:58:55 2005
>> @@ -572,7 +572,8 @@
>>          jobDataMap.put(DATA_MAP_LOGGER, getLogger());
>>          jobDataMap.put(DATA_MAP_CONTEXT, this.context);
>>          jobDataMap.put(DATA_MAP_MANAGER, this.manager);
>> -        jobDataMap.put(DATA_MAP_RUN_CONCURRENT, concurent? 
>> Boolean.TRUE: Boolean.FALSE);
>> +        jobDataMap.put(DATA_MAP_RUN_CONCURRENT,
>> +            concurent? Boolean.TRUE.booleanValue(): 
>> Boolean.FALSE.booleanValue());
>
>
> Won't it fail later on here?
> final Boolean canRunConcurrentlyB = ((Boolean) 
> data.get(QuartzJobScheduler.DATA_MAP_RUN_CONCURRENT));
>
>
> Vadim 

No.  There are multiple versions of the put method. The one that takes 
boolean actually creates a Boolean and stores it.  I changed it because 
IntelliJ was complaining that it couldn't figure out whether to use 
put(Object, Object) or put(String, boolean).  Presumably this shows up 
as a warning somewhere during compilation.

Ralph