cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Antonio Gallardo" <agalla...@agssa.net>
Subject Re: svn commit: r123817 - /cocoon/branches/BRANCH_2_1_X/src/blocks/javaflow/java/org/apache/coco on/forms/flow/java/FormInstance.java
Date Sat, 01 Jan 2005 12:11:36 GMT
On Vie, 31 de Diciembre de 2004, 15:52, Joerg Heinicke dijo:
> On 31.12.2004 20:22, antonio@apache.org wrote:
>
>> Author: antonio
>> Date: Fri Dec 31 11:22:15 2004
>> New Revision: 123817
>>
>> URL: http://svn.apache.org/viewcvs?view=rev&rev=123817
>> Log:
>> Remove unused code (src is always = null)
>> Modified:
>>    cocoon/branches/BRANCH_2_1_X/src/blocks/javaflow/java/org/apache/cocoon/forms/flow/java/FormInstance.java
>>
>> Modified:
>> cocoon/branches/BRANCH_2_1_X/src/blocks/javaflow/java/org/apache/cocoon/forms/flow/java/FormInstance.java
>> Url:
>> http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/javaflow/java/org/apache/cocoon/forms/flow/java/FormInstance.java?view=diff&rev=123817&p1=cocoon/branches/BRANCH_2_1_X/src/blocks/javaflow/java/org/apache/cocoon/forms/flow/java/FormInstance.java&r1=123816&p2=cocoon/branches/BRANCH_2_1_X/src/blocks/javaflow/java/org/apache/cocoon/forms/flow/java/FormInstance.java&r2=123817
>> ==============================================================================
>
>> @@ -88,7 +88,6 @@
>>      public FormInstance(Element formDefinition) {
>>          FormManager formMgr = null;
>>          SourceResolver resolver = null;
>> -        Source src = null;
>>          try {
>>              formMgr = (FormManager)getComponent(FormManager.ROLE);
>>              resolver =
>> (SourceResolver)getComponent(SourceResolver.ROLE);
>> @@ -98,7 +97,6 @@
>>              throw new CascadingRuntimeException("Could not create form
>> instance", e);
>>          } finally {
>>              releaseComponent(formMgr);
>> -            if (src != null) resolver.release(src);
>>              releaseComponent(resolver);
>>          }
>>      }
>
> You can reduce it even more, formMgr and resolver are neither needed,
> they were just copied from the FormInstance(String) constructor:
>
>      public FormInstance(Element formDefinition) {
>          try {
>              this.form = formMgr.createForm(formDefinition);
>              this.binding = null;
>          } catch (Exception e) {
>              throw new CascadingRuntimeException("Could not create form
> instance", e);
>          }
>      }

Thanks. :-D

I removed the resolver, but the formMgr is needed to create a newform. The
changes are already committed.

Best Regards,

Antonio Gallardo.


Mime
View raw message