No announcement yet.

Comparing Java and C#

  • Filter
  • Time
  • Show
Clear All
new posts

  • Comparing Java and C#

    When comparing a Java file to a similar C# file, and there are corresponding lines that contain "false" or "true", BC seems to mark that "false" or "true" as a difference, even though the lines are identical. This mostly happens on lines that are just some whitespace then "return false;" (identical in both files).

    This is somewhat annoying when I compare a Java file to the C# port of that file to spot differences, and I'd like those lines to not be marked as differences... Am I doing something wrong here?

    I am using BC 3.3.12 (build 18414) on Windows 7.

    I have attached a pair of files that trigger this problem.

  • #2

    If text is detected as a different grammar type, then it is marked as a difference even if the text itself is the same. Most commonly, you can see this between //comments and non-comments.

    Here, one is an Identifier and the other is a Keyword, according to the different formats. You can alter the grammar definitions, and add "true" and "false" as Identifiers to the Java format, or delete them from the C format Identifier list.
    Aaron P Scooter Software


    • #3
      Adding "true" and "false" as Keywords to the Java format did the trick, thanks!