When considering this question about re-formatting Cell (also this one), I encountered an issue which confuses me. I'll let the code itself speak:

Consider the following simple Cell expression, which contains a comment line:

cellexpr =
Cell[BoxData[{RowBox[{RowBox[{"a", ";"}], "\[IndentingNewLine]",
RowBox[{"(*", RowBox[{"b", ";"}], "*)"}]}],
"\[IndentingNewLine]", "c"}], "Input"];


Write it to a Notebook:

testnb = NotebookCreate[];
NotebookWrite[testnb, cellexpr];


It looks like the following, which is what one would expect:

Now read the Cell expression back from testnb:

SelectionMove[testnb, Before, Notebook];
SelectionMove[testnb, Next, Cell];


Note the first RowBox, it has a structure as RowBox[ item1, item2, ...], which is ill-posed since the first argument to RowBox must be a list. And the obtained Cell expression is therefor ill-posed, which can be seen by CellPrint-ing it:

I noticed that if the comment-line part is removed (e.g. by deleting "(*" and "*)" in cellexpr), everything works fine. And for the example in this question, the second comment is correctly obtained:

# My question:

Did I miss something? Or is this a bug?

My system: Mathematica 9.0.0.0 on Windows 7 32-bit

-
This may have been fixed in 9.0.1. Please take a look at what I got with 9.0.1 on OS X: i.stack.imgur.com/8J6Oy.png –  Szabolcs Feb 25 '13 at 19:13
@Szabolcs Thanks for the information! Now I begin to wonder when and why this wired bug.. –  Silvia Feb 25 '13 at 19:19
This is very similar to a bug I encountered with Mathematica version 5 on windowsXP. The problem was : when I had a comment at the end of a cell, the cell became sometimes corrupted. A look inside the cell with ctrl-shift-E reveals a Row without List inside. –  andre Feb 25 '13 at 21:43
(follow the last comment) Maybe this problem has something to do with the fact there are two different characters * (see doc or ask details). These characters are very similar, but I saw at screen that the * in the (* was not the same as in *) (depending on system?) –  andre Feb 25 '13 at 21:46
It was a bug, newly introduced to 9.0.0, and subsequently fixed in 9.0.1. The same problem led to the oft-reported corruption of certain cells when you tired to merge them. –  John Fultz Feb 27 '13 at 10:46