Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8072390

extra semicolon between imports does not cause compile error

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • P4
    • None
    • 7u75
    • tools
    • x86_64
    • linux_ubuntu

    Description

      FULL PRODUCT VERSION :
      java version "1.7.0_75"
      Java(TM) SE Runtime Environment (build 1.7.0_75-b13)
      Java HotSpot(TM) Server VM (build 24.75-b04, mixed mode)

      ADDITIONAL OS VERSION INFORMATION :
      Ubuntu 12.04 64 bit

      A DESCRIPTION OF THE PROBLEM :
      Good examples and explanation of problem is here
      https://bugs.eclipse.org/bugs/show_bug.cgi?id=425140

      Please fix Grammar ( .... HTML documents) or fix javac to raise an error

      It would be good to be certain in this area as that affect other projects:
      https://github.com/checkstyle/checkstyle/commit/a4e79cf45cf1c2cdf6d598e475f22e4967029d77
      https://groups.google.com/d/msg/checkstyle-devel/7wlc3hadksM/LdSJvg-5fTcJ

      I do not remember exact name of file but openjdk8 had or still have such file with double semicolon.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Try to compile following code:

      import java.util.List;
      ; // Extra semicolon
      import java.util.Set;

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Error, as in grammar where is no rule that describe that
      ACTUAL -
      no error

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------

      import java.util.List;
      ; // Extra semicolon
      import java.util.Set;
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      remove extra symbol ";"

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              webbuggrp Webbug Group
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: