Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > need a tool to compare java source files

Reply
Thread Tools

need a tool to compare java source files

 
 
alan jeeves
Guest
Posts: n/a
 
      03-03-2004
Hi,

I need a tool to compare java source files - does any one know of any?

It would be prefered if it does actually compare the code and not be based
on just plain text - hope you know what i mean.

Thanks,
Alan.


 
Reply With Quote
 
 
 
 
Michael Borgwardt
Guest
Posts: n/a
 
      03-03-2004
alan jeeves wrote:
> I need a tool to compare java source files - does any one know of any?
>
> It would be prefered if it does actually compare the code and not be based
> on just plain text - hope you know what i mean.


What kind of "comparison" do you want? Syntactical identity? In that case,
a combination of a code formatter and a simple diff should do fine.

If you meant semantical identity, I don't think that's feasible.

 
Reply With Quote
 
 
 
 
alan jeeves
Guest
Posts: n/a
 
      03-03-2004
I'm managing to do it with a simple text comparsion app,

but thanks


"Michael Borgwardt" <> wrote in message
news:c24lr5$1p0s87$...
> alan jeeves wrote:
> > I need a tool to compare java source files - does any one know of any?
> >
> > It would be prefered if it does actually compare the code and not be

based
> > on just plain text - hope you know what i mean.

>
> What kind of "comparison" do you want? Syntactical identity? In that case,
> a combination of a code formatter and a simple diff should do fine.
>
> If you meant semantical identity, I don't think that's feasible.
>



 
Reply With Quote
 
Michael Borgwardt
Guest
Posts: n/a
 
      03-03-2004
alan jeeves wrote:

> I'm managing to do it with a simple text comparsion app,


That's what I meant with "simple diff". Combining it with a code
formatter would offer the advantage of ignoring differences in
formatting and whitespace. Beyond that, I don't see how any
big improvement could be made.

 
Reply With Quote
 
Mickey Segal
Guest
Posts: n/a
 
      03-03-2004
"alan jeeves" <> wrote in message
news:c24l2k$lhe$...
> I need a tool to compare java source files - does any one know of any?


Microsoft's WinDiff.exe:
http://www.tburke.net/info/suptools/topics/windiff.htm
which came with Visual J++ 6.0 and various Windows support and resource
kits, does such a comparison. If it is already on your computer it is worth
trying.


 
Reply With Quote
 
Thomas Weidenfeller
Guest
Posts: n/a
 
      03-03-2004
alan jeeves wrote:
> I need a tool to compare java source files - does any one know of any?


Yes, I wrote a Unix diff clone in Java, just for fun. Of course, the
real diff programs will do just fine, too.

> It would be prefered if it does actually compare the code and not be based
> on just plain text


Nop. And definitely not my little diff (it can ignore whitespace, but
that's it).

If you can't find anything, I would suggest some pre-processing. Remove
comments, all whitespace, etc.. Than run it through any diff command of
your choice.

/Thomas

 
Reply With Quote
 
Jon A. Cruz
Guest
Posts: n/a
 
      03-03-2004
alan jeeves wrote:
> Hi,
>
> I need a tool to compare java source files - does any one know of any?
>
> It would be prefered if it does actually compare the code and not be based
> on just plain text - hope you know what i mean.


I usually use either tkdiff (with tkcvs) or Eclipse. The latter has a
very niced styled diff viewer with sliding comparison areas like Sun's
CM tool used to.


 
Reply With Quote
 
Jon A. Cruz
Guest
Posts: n/a
 
      03-04-2004
Thomas Weidenfeller wrote:
> Nop. And definitely not my little diff (it can ignore whitespace, but
> that's it).
>
> If you can't find anything, I would suggest some pre-processing. Remove
> comments, all whitespace, etc.. Than run it through any diff command of
> your choice.



Try tkdiff (grab tkcvs) and give it the option to ignore whitespace
(might be in the gui) -b

And sometimes you want --ignore-all-space.

 
Reply With Quote
 
Thomas Weidenfeller
Guest
Posts: n/a
 
      03-04-2004
Jon A. Cruz wrote:
> Try tkdiff (grab tkcvs) and give it the option to ignore whitespace
> (might be in the gui) -b
>
> And sometimes you want --ignore-all-space.


Space "folding" and completely ignoring spaces is implemented in my
little diff (and all Unix diff versions I am aware of since Unix Version
7). So any diff should be a good start. However, I assumed that this is
not enough for the OP. For me it sounded he also wants to ignore
comments and line breaks (anything ignored by the compiler, too). I
don't know any tool which does this.

/Thomas

 
Reply With Quote
 
Krystan Honour
Guest
Posts: n/a
 
      03-04-2004
Thought you might like to take a look here

http://keithdevens.com/downloads/

"alan jeeves" <> wrote in message news:<c24l2k$lhe$>...
> Hi,
>
> I need a tool to compare java source files - does any one know of any?
>
> It would be prefered if it does actually compare the code and not be based
> on just plain text - hope you know what i mean.
>
> Thanks,
> Alan.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Need tool to find necessary "import" statements for given java source; Raymond Schanks Java 1 07-29-2010 01:09 PM
need recommendations on what brand, specific computer tool kit to buy (physical tool kits, not software kits/suites) Trevor Smithson Computer Information 1 05-27-2005 01:15 AM
need recommendations on what brand, specific computer tool kit to buy (physical tool kits, not software kits/suites) Trevor Smithson Computer Support 5 05-25-2005 07:48 PM
Looking For a tool to crawl ASP and compare to a folder of files to see which are used and which are not. Steve Mauldin ASP General 0 02-06-2004 04:15 PM
Using XSL to compare two XML files - Need help please! Frank XML 1 09-12-2003 05:22 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57