You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by Patrick Linskey <pl...@bea.com> on 2007/02/02 22:55:04 UTC

RE: svn commit: r502751 - in /incubator/openjpa/trunk: openjpa-kernel/src/main/java/org/apache/openjpa/kernel/ openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/simple/ openjpa-persistence/src/main/java/org/apache/openjpa/persistence/

Hi,

To date, almost all of the OpenJPA code uses single-line-style comments
inside method blocks, instead of multi-line comments. I prefer sticking
with this convention; my excuse is that it makes it easier to comment
out blocks of code during debugging, since you can use /*-style comments
when debugging with impunity if there are no /*-style comments in the
code. But really, it's probably just personal bias.

Thoughts?

-Patrick

+                /* Check for null here because _brokers is a 
> weak reference
> +                collection */
>                  if ((broker != null) && (!broker.isClosed()))
>                      broker.close();



> -            if ((_flags & FLAG_FLUSH_REQUIRED) != 0)
> +            /* If a flush is desired (based on input parm), 
> then check if the
> +             * "dirty" flag is set before calling flush().
> +             */
> +            if ((flush) && ((_flags & FLAG_FLUSH_REQUIRED) != 0))
>                  flush();
>              detachAllInternal(call);

> -        catch(IllegalStateException ise) {
> -            /*
> -             * An IllegalStateException is expected. Nothing 
> to do here.
> -             */
> -        }

_______________________________________________________________________
Notice:  This email message, together with any attachments, may contain
information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated
entities,  that may be confidential,  proprietary,  copyrighted  and/or
legally privileged, and is intended solely for the use of the individual
or entity named in this message. If you are not the intended recipient,
and have received this message in error, please immediately return this
by email and then delete it.

Re: svn commit: r502751 - in /incubator/openjpa/trunk: openjpa-kernel/src/main/java/org/apache/openjpa/kernel/ openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/simple/ openjpa-persistence/src/main/java/org/apache/openjpa/persistence/

Posted by Abe White <aw...@bea.com>.
> interesting.  I always did it the other way - use /* */ in code,  
> and // for commenting out blocks :)

If you have an IDE that can prefix every line in a block with '//' to  
comment it out, it will work regardless of comment style.  But for  
non-IDE users, /**/ is the only efficient way to comment out blocks.

I agree with Patrick completely: let's stick to // comments in code,  
both to stay consistent with the rest of the codebase and to  
facilitate commenting out blocks.
_______________________________________________________________________
Notice:  This email message, together with any attachments, may contain
information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated
entities,  that may be confidential,  proprietary,  copyrighted  and/or
legally privileged, and is intended solely for the use of the individual
or entity named in this message. If you are not the intended recipient,
and have received this message in error, please immediately return this
by email and then delete it.

Re: svn commit: r502751 - in /incubator/openjpa/trunk: openjpa-kernel/src/main/java/org/apache/openjpa/kernel/ openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/simple/ openjpa-persistence/src/main/java/org/apache/openjpa/persistence/

Posted by "Geir Magnusson Jr." <ge...@pobox.com>.
interesting.  I always did it the other way - use /* */ in code,  
and // for commenting out blocks :)

On Feb 2, 2007, at 4:55 PM, Patrick Linskey wrote:

> Hi,
>
> To date, almost all of the OpenJPA code uses single-line-style  
> comments
> inside method blocks, instead of multi-line comments. I prefer  
> sticking
> with this convention; my excuse is that it makes it easier to comment
> out blocks of code during debugging, since you can use /*-style  
> comments
> when debugging with impunity if there are no /*-style comments in the
> code. But really, it's probably just personal bias.
>
> Thoughts?
>
> -Patrick
>
> +                /* Check for null here because _brokers is a
>> weak reference
>> +                collection */
>>                  if ((broker != null) && (!broker.isClosed()))
>>                      broker.close();
>
>
>
>> -            if ((_flags & FLAG_FLUSH_REQUIRED) != 0)
>> +            /* If a flush is desired (based on input parm),
>> then check if the
>> +             * "dirty" flag is set before calling flush().
>> +             */
>> +            if ((flush) && ((_flags & FLAG_FLUSH_REQUIRED) != 0))
>>                  flush();
>>              detachAllInternal(call);
>
>> -        catch(IllegalStateException ise) {
>> -            /*
>> -             * An IllegalStateException is expected. Nothing
>> to do here.
>> -             */
>> -        }
>
> ______________________________________________________________________ 
> _
> Notice:  This email message, together with any attachments, may  
> contain
> information  of  BEA Systems,  Inc.,  its subsidiaries  and   
> affiliated
> entities,  that may be confidential,  proprietary,  copyrighted   
> and/or
> legally privileged, and is intended solely for the use of the  
> individual
> or entity named in this message. If you are not the intended  
> recipient,
> and have received this message in error, please immediately return  
> this
> by email and then delete it.