bug: java source tidied file format problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • marcelo
    Visitor
    • Jul 2008
    • 5

    bug: java source tidied file format problem

    I often compare Java source files.
    When I open the file diff in BC3, most of the time the "Java Source Tidied" file format is automatically selected.
    When this happens, often times the file comparison is plain wrong, showing no differences when there are, and showing differences when there are none.

    To see the proper differences I have to change the file format to "Java Source" on bothe the right and left panes.
    As a workaround I ended up disabling the "Java Source Tidied" file format.
  • Chris
    Team Scooter
    • Oct 2007
    • 5538

    #2
    Marcelo,

    The "Java Source Tidied" file format cleans up formatting in Java files before opening files. That might explain why you aren't seeing some differences when you use the format.
    Chris K Scooter Software

    Comment

    • marcelo
      Visitor
      • Jul 2008
      • 5

      #3
      but is does not explain why in some cases, it shows differences when the files are identical. To me, the feature is unreliable at best.

      Comment

      • Chris
        Team Scooter
        • Oct 2007
        • 5538

        #4
        The "Java Source Tidied" file format isn't a default file format. You have to download it from our web site as an add on, so it should only be used if you specifically need to ignore formatting differences in Java Source files.

        The file format uses Jalopy as an external application to format the source code, so if you're not happy with the formatting results, you might want to consult the Jalopy documention.
        Chris K Scooter Software

        Comment

        • kcalman
          Enthusiast
          • Jun 2004
          • 32

          #5
          I too am seeing strange differences between java source files, having to do with header comment placement. I have files that have headers like:
          Code:
          /* $Id$ $DateTime$ $Change$ $Author$ */
          /*
           * Copyright (c) 2009 ACS State and Local Solutions
           * All rights reserved.
           *
           * THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF ACS
           * The copyright notice above does not evidence any actual or
           * intended publication of such source code.
           *
           */
          
          import java.io.*;
          
          import javax.xml.validation.*;
          import javax.xml.transform.*;
          import javax.xml.transform.stream.StreamSource;
          import org.xml.sax.*;
          import org.xml.sax.helpers.*;
          and when the "Java Source Tidied" format is selected, I see

          Code:
          import org.xml.sax.*;
          import org.xml.sax.helpers.*;
          
          /* $Id$ $DateTime$ $Change$ $Author$ */
          /*
           * Copyright (c) 2009 ACS State and Local Solutions
           * All rights reserved.
           *
           * THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF ACS
           * The copyright notice above does not evidence any actual or
           * intended publication of such source code.
           *
           */
          import java.io.*;
          
          import javax.xml.transform.*;
          import javax.xml.transform.stream.StreamSource;
          import javax.xml.validation.*;
          Why is Jalopy rearranging the comments, and what can I do to make the comments always appear at the top of the file in the 'tidied' version?

          Comment

          • Chris
            Team Scooter
            • Oct 2007
            • 5538

            #6
            Sorry, I don't know much about Jalopy. You'll need to consult the Jalopy documentation to see if there are any options you can use to change the output. The Jalopy web site is http://jalopy.sourceforge.net/.
            Chris K Scooter Software

            Comment

            Working...