A
Alex Hunsley
This is probably a vain hope, but here goes...
Does anyone know of a java source diff tool that ignores whitespace AND
newlines, and just looks at code blocks intelligently?
For instance, the tool would consider the following two groups of lines identical:
group A: (just one line!)
if (evil == true && power > 7) { destroyStuff(); }
group B:
if (evil == true
&& power > 7) {
destroyStuff();
}
The reason I ask is that sometimes I run eclipse source auto formatting over
some weirdly formatted code that someone else has written, in order to make it
more standard and much easier to debug (because group A above is really bad for
stepping over with debugger in a diagnostic way!)
However, I then have the problem that my code is *very* different to the
checked in code, but there is *probably* no functional change, but it's hard to
tell.
(Yes, I should have done the reformat and checked the code straight back in,
but I didn't.. booo.)
I suppose I could always keep a copy of my altered code somewhere else, check
out the code and reformat AGAIN, and diff those two....hmmm.
alex
Does anyone know of a java source diff tool that ignores whitespace AND
newlines, and just looks at code blocks intelligently?
For instance, the tool would consider the following two groups of lines identical:
group A: (just one line!)
if (evil == true && power > 7) { destroyStuff(); }
group B:
if (evil == true
&& power > 7) {
destroyStuff();
}
The reason I ask is that sometimes I run eclipse source auto formatting over
some weirdly formatted code that someone else has written, in order to make it
more standard and much easier to debug (because group A above is really bad for
stepping over with debugger in a diagnostic way!)
However, I then have the problem that my code is *very* different to the
checked in code, but there is *probably* no functional change, but it's hard to
tell.
(Yes, I should have done the reformat and checked the code straight back in,
but I didn't.. booo.)
I suppose I could always keep a copy of my altered code somewhere else, check
out the code and reformat AGAIN, and diff those two....hmmm.
alex