You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by "David M. Karr" <dm...@earthlink.net> on 2002/11/08 07:10:21 UTC

javadoc & Weird state of org/apache/struts/util/AppException.java

When I view the file "src/share/org/apache/struts/util/AppException.java" in
Cygwin/XEmacs (binmode), it shows up as a SINGLE line (the entire file), with
linefeeds ("\r" in "od") instead of newlines.  I see just about the same in
"vi".  I noticed David G. made some formatting changes in this file a couple of
weeks ago.  Apparently every other line was a blank line, for some reason?
The blank lines appeared when Rob Leland made some minor changes about 7 weeks
ago.  In my copy, if I just replace the "^M"s (what shows in XEmacs) with a
newline, the file looks fine, and the "od" output shows normal newlines (just
like other files).

I also notice that in "src/share/org/apache/struts/validator",
"ValidatorForm.java" and "DynaValidatorForm.java" are in the same state.

These are noticeable because the build reports javadoc warnings on these files
(and some others which I'm still trying to figure out).

Looking at these errors also points out the "-breakiterator" option to javadoc,
which is new to me.  Apparently this causes it to use a more intelligent
algorithm for determining the end of a sentence (although it's apparently the
default in JDK 1.4).  Apparently there are several examples of "i.e." in Struts
javadoc that causes a truncated string in the generated javadoc.
Unfortunately, I don't see any way to provide this option to the "javadoc" task
in Ant, so I can at least (easily) see what it does.

-- 
===================================================================
David M. Karr          ; Java/J2EE/XML/Unix/C++
dmkarr@earthlink.net   ; SCJP



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: javadoc & Weird state of org/apache/struts/util/AppException.java

Posted by Paul Speed <ps...@progeeks.com>.
FWIW...

This is usually caused by manually copying files from a DOS/Windows
machine to a Unix machine and then checking them in.  However it
is caused, it happens when you check a DOS-formatted file in from a
Unix machine.  In this case, CVS stores the file as-is with \r\n's
intact.  If checked in from a DOS/Win machine, CVS would automatically
convert the \r\n's to \n's which it uses internally.

So, if you attempt to check out the file with \r\n's from a Win/DOS
machine, CVS will add an extra \r when converting the \n's to \r\n's.
So each line will now end with a \r\r\n.  Improperly "fixing" this
double-line situation is usually what causes the file to be checked 
back in with only \r's.

Moral of the story: don't check-in DOS formatted files from a Unix
formatted system unless they are marked as binary.  And if you do
check them in by accident, be careful how you fix it. ;)

-Paul

"David M. Karr" wrote:
> 
> When I view the file "src/share/org/apache/struts/util/AppException.java" in
> Cygwin/XEmacs (binmode), it shows up as a SINGLE line (the entire file), with
> linefeeds ("\r" in "od") instead of newlines.  I see just about the same in
> "vi".  I noticed David G. made some formatting changes in this file a couple of
> weeks ago.  Apparently every other line was a blank line, for some reason?
> The blank lines appeared when Rob Leland made some minor changes about 7 weeks
> ago.  In my copy, if I just replace the "^M"s (what shows in XEmacs) with a
> newline, the file looks fine, and the "od" output shows normal newlines (just
> like other files).
> 
> I also notice that in "src/share/org/apache/struts/validator",
> "ValidatorForm.java" and "DynaValidatorForm.java" are in the same state.
> 
> These are noticeable because the build reports javadoc warnings on these files
> (and some others which I'm still trying to figure out).
> 
> Looking at these errors also points out the "-breakiterator" option to javadoc,
> which is new to me.  Apparently this causes it to use a more intelligent
> algorithm for determining the end of a sentence (although it's apparently the
> default in JDK 1.4).  Apparently there are several examples of "i.e." in Struts
> javadoc that causes a truncated string in the generated javadoc.
> Unfortunately, I don't see any way to provide this option to the "javadoc" task
> in Ant, so I can at least (easily) see what it does.
> 
> --
> ===================================================================
> David M. Karr          ; Java/J2EE/XML/Unix/C++
> dmkarr@earthlink.net   ; SCJP
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: javadoc & Weird state of org/apache/struts/util/AppException.java

Posted by Rob Leland <rl...@apache.org>.
David M. Karr wrote:

> When I view the file 
> "src/share/org/apache/struts/util/AppException.java" in
> Cygwin/XEmacs (binmode), it shows up as a SINGLE line (the entire 
> file), with
> linefeeds ("\r" in "od") instead of newlines.  I see just about the 
> same in
> "vi".  I noticed David G. made some formatting changes in this file a 
> couple of
> weeks ago.  Apparently every other line was a blank line, for some reason?
> The blank lines appeared when Rob Leland made some minor changes about 
> 7 weeks
> ago.  In my copy, if I just replace the "^M"s (what shows in XEmacs) 
> with a
> newline, the file looks fine, and the "od" output shows normal 
> newlines (just
> like other files).
>
> I also notice that in "src/share/org/apache/struts/validator",
> "ValidatorForm.java" and "DynaValidatorForm.java" are in the same state.

I can verify that using vim under cygwin. It looks Ok using IntelliJ.
I'll see if I can figure out which program is doing that and STOP using it!

-Rob


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: javadoc & Weird state of org/apache/struts/util/AppException.java

Posted by "Craig R. McClanahan" <cr...@apache.org>.

On 7 Nov 2002, David M. Karr wrote:

> Date: 07 Nov 2002 22:10:21 -0800
> From: David M. Karr <dm...@earthlink.net>
> Reply-To: Struts Developers List <st...@jakarta.apache.org>
> To: struts-dev@jakarta.apache.org
> Subject: javadoc & Weird state of org/apache/struts/util/AppException.java
>
> When I view the file "src/share/org/apache/struts/util/AppException.java" in
> Cygwin/XEmacs (binmode), it shows up as a SINGLE line (the entire file), with
> linefeeds ("\r" in "od") instead of newlines.  I see just about the same in
> "vi".  I noticed David G. made some formatting changes in this file a couple of
> weeks ago.  Apparently every other line was a blank line, for some reason?
> The blank lines appeared when Rob Leland made some minor changes about 7 weeks
> ago.  In my copy, if I just replace the "^M"s (what shows in XEmacs) with a
> newline, the file looks fine, and the "od" output shows normal newlines (just
> like other files).
>
> I also notice that in "src/share/org/apache/struts/validator",
> "ValidatorForm.java" and "DynaValidatorForm.java" are in the same state.
>

As others have pointed out, this generally happens when you check
something out under DOS and check it in under Unix (real easy to do by
accident if you've got your CVS checkout directory mapped to both kinds of
systems).  I don't use CYGWIN, but wouldn't be surprised if it is
sometimes schizophrenic with regard to it's true nature :-)

In the past, I've been able to fix this kind of thing as follows:
* Check out on a DOS system
* Use a text editor that knows how to reformat the
  line endings to Unix style (I like Textpad for this)
* Check it back in on the DOS system.

The alternative is to delete and readd the file, but that makes the change
history harder to follow.

> These are noticeable because the build reports javadoc warnings on these files
> (and some others which I'm still trying to figure out).
>

The most common one was introduced by JDK 1.4, and is really annoying --
it does not like a question mark at the end of the first sentence.  This
makes it tough to document boolean getter methods and variables, where it
is quite natural to say things like:

  /**
   * Is this component active?
   */
  boolean active = true;

Sigh.

> Looking at these errors also points out the "-breakiterator" option to javadoc,
> which is new to me.  Apparently this causes it to use a more intelligent
> algorithm for determining the end of a sentence (although it's apparently the
> default in JDK 1.4).  Apparently there are several examples of "i.e." in Struts
> javadoc that causes a truncated string in the generated javadoc.

That one causes problems, too, because it is misinterpreted as a sentence
ending.  I've taken to using "ie" instead of "i.e.".

> Unfortunately, I don't see any way to provide this option to the "javadoc" task
> in Ant, so I can at least (easily) see what it does.
>
> --
> ===================================================================
> David M. Karr          ; Java/J2EE/XML/Unix/C++
> dmkarr@earthlink.net   ; SCJP
>
>

Craig


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>