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

Syntactically meaningless code accepted by javac

    Details

    • Subcomponent:
    • Resolved In Build:
      b76
    • CPU:
      x86
    • OS:
      windows_8
    • Verification:
      Verified

      Backports

        Description

        FULL PRODUCT VERSION :
        java version "1.8.0_51"
        Java(TM) SE Runtime Environment (build 1.8.0_51-b16)
        Java HotSpot(TM) 64-Bit Server VM (build 25.51-b03, mixed mode)


        ADDITIONAL OS VERSION INFORMATION :
        Microsoft Windows

        A DESCRIPTION OF THE PROBLEM :
        The following code has a syntax error, but is nonetheless accepted by javac:

        class A {
            static Runnable r = (__GAR BAGE__.this) -> { };
        }


        REGRESSION. Last worked in version 7u85

        ADDITIONAL REGRESSION INFORMATION:
        This was a syntax error in previous versions.


        STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
        javac A.java

        EXPECTED VERSUS ACTUAL BEHAVIOR :
        EXPECTED -
        Syntax error
        ACTUAL -
        No error and class file produced

        REPRODUCIBILITY :
        This bug can be reproduced always.

        ---------- BEGIN SOURCE ----------
        class A {
            static Runnable r = (__GAR BAGE__.this) -> { };
        }

        ---------- END SOURCE ----------

        CUSTOMER SUBMITTED WORKAROUND :
        If it hurts, don't do that.

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  mcimadamore Maurizio Cimadamore
                  Reporter:
                  webbuggrp Webbug Group
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  7 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: