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

Minor cleanup of some dead code in Flow.java

    XMLWordPrintable

Details

    • b25
    • generic
    • generic

    Description

      ADDITIONAL SYSTEM INFORMATION :
      jdk-20+22-65-gdd5d4df5b68


      A DESCRIPTION OF THE PROBLEM :
      There is some dead code in Flow.java that can be safely removed by this patch:

      diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Flow.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Flow.java
      index 55b214b6a7e..d9e2f5ac4a5 100644
      --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Flow.java
      +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Flow.java
      @@ -2170,16 +2170,12 @@ public class Flow {
               public void visitClassDef(JCClassDecl tree) {
                   if (tree.sym == null) {
                       return;
                   }
       
                   Lint lintPrev = lint;
                   lint = lint.augment(tree.sym);
                   try {
      - if (tree.sym == null) {
      - return;
      - }
      -
                       JCClassDecl classDefPrev = classDef;
                       int firstadrPrev = firstadr;
                       int nextadrPrev = nextadr;
                       ListBuffer<PendingExit> pendingExitsPrev = pendingExits;
      @@ -2254,27 +2250,18 @@ public class Flow {
               public void visitMethodDef(JCMethodDecl tree) {
                   if (tree.body == null) {
                       return;
                   }
       
                   /* MemberEnter can generate synthetic methods ignore them
                    */
                   if ((tree.sym.flags() & SYNTHETIC) != 0) {
                       return;
                   }
       
                   Lint lintPrev = lint;
                   lint = lint.augment(tree.sym);
                   try {
      - if (tree.body == null) {
      - return;
      - }
      - /* Ignore synthetic methods, except for translated lambda methods.
      - */
      - if ((tree.sym.flags() & (SYNTHETIC | LAMBDA_METHOD)) == SYNTHETIC) {
      - return;
      - }
      -
                       final Bits initsPrev = new Bits(inits);
                       final Bits uninitsPrev = new Bits(uninits);
                       int nextadrPrev = nextadr;
                       int firstadrPrev = firstadr;


      REGRESSION : Last worked in version 8


      CUSTOMER SUBMITTED WORKAROUND :
      None.

      FREQUENCY : always


      Attachments

        Issue Links

          Activity

            People

              acobbs Archie Cobbs
              webbuggrp Webbug Group
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: