need a tool to compare java source files

Discussion in 'Java' started by alan jeeves, Mar 3, 2004.

  1. alan jeeves

    alan jeeves Guest

    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.
     
    alan jeeves, Mar 3, 2004
    #1
    1. Advertising

  2. 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.
     
    Michael Borgwardt, Mar 3, 2004
    #2
    1. Advertising

  3. alan jeeves

    alan jeeves Guest

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

    but thanks


    "Michael Borgwardt" <> wrote in message
    news:c24lr5$1p0s87$-berlin.de...
    > 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.
    >
     
    alan jeeves, Mar 3, 2004
    #3
  4. 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.
     
    Michael Borgwardt, Mar 3, 2004
    #4
  5. alan jeeves

    Mickey Segal Guest

    "alan jeeves" <> wrote in message
    news:c24l2k$lhe$2surf.net...
    > 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.
     
    Mickey Segal, Mar 3, 2004
    #5
  6. 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
     
    Thomas Weidenfeller, Mar 3, 2004
    #6
  7. alan jeeves

    Jon A. Cruz Guest

    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.
     
    Jon A. Cruz, Mar 3, 2004
    #7
  8. alan jeeves

    Jon A. Cruz Guest

    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.
     
    Jon A. Cruz, Mar 4, 2004
    #8
  9. 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
     
    Thomas Weidenfeller, Mar 4, 2004
    #9
  10. Thought you might like to take a look here :)

    http://keithdevens.com/downloads/

    "alan jeeves" <> wrote in message news:<c24l2k$lhe$2surf.net>...
    > 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.
     
    Krystan Honour, Mar 4, 2004
    #10
  11. "alan jeeves" <> writes:
    >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.


    You may want to look at the Complite File Comparison Family at
    http://world.std.com/~jdveale

    These utilities perform a true word-by-word comparison where words
    may be separated not only by white-space but by common programming
    language delimiters. This avoids many issues with code formating.

    In addition the keyword processing capabilites can be configured
    to ignore most comments, or other application specific requirements.

    Demonstration versions and contact information is on the web page.

    Jim Veale
     
    James D. Veale, Mar 5, 2004
    #11
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Frank
    Replies:
    1
    Views:
    760
    Dimitre Novatchev
    Sep 12, 2003
  2. Raymond Schanks
    Replies:
    1
    Views:
    410
  3. Steve Mauldin
    Replies:
    0
    Views:
    145
    Steve Mauldin
    Feb 6, 2004
  4. Michael

    The best Compare and Migrate Tool

    Michael, Nov 30, 2006, in forum: ASP General
    Replies:
    0
    Views:
    115
    Michael
    Nov 30, 2006
  5. Fabian Marin
    Replies:
    13
    Views:
    364
    Roger Pack
    Jul 30, 2010
Loading...

Share This Page