CFR, Fernflower, Vineflower: No line numbers available in class file · Issue #118 · ecd-plugin/ecd · GitHub
Skip to content

CFR, Fernflower, Vineflower: No line numbers available in class file #118

Open

Description

@basinilya

Version 3.5.1, Eclipse 4.36.0
I'm checking org.slf4j.Logger from slf4j-api-2.0.7.jar.
Unless I choose "JD Core" or "Procyon", there's the comment at the beginning of decompiled class:

// Warning: No line numbers available in class file

Yet, with CFR or Fernflower the line numbers are there!

   default boolean isEnabledForLevel(Level level) {
      int levelInt = level.toInt();// 146
      switch (levelInt) {// 147
         case 0:
            return this.isTraceEnabled();// 149
         case 10:
            return this.isDebugEnabled();// 151
         case 20:
            return this.isInfoEnabled();// 153
         case 30:
            return this.isWarnEnabled();// 155
         case 40:
            return this.isErrorEnabled();// 157
         default:
            throw new IllegalArgumentException("Level [" + level + "] not recognized.");// 159
      }
   }

With Vineflower there are no line number comments at all.

With JD Core or Procyon it still works:

/*     */   default boolean isEnabledForLevel(Level level) {
/* 146 */     int levelInt = level.toInt();
/* 147 */     switch (levelInt) {
/*     */       case 0:
/* 149 */         return isTraceEnabled();
/*     */       case 10:
/* 151 */         return isDebugEnabled();
/*     */       case 20:
/* 153 */         return isInfoEnabled();
/*     */       case 30:
/* 155 */         return isWarnEnabled();
/*     */       case 40:
/* 157 */         return isErrorEnabled();
/*     */     } 
/* 159 */     throw new IllegalArgumentException("Level [" + level + "] not recognized.");
/*     */   }

Activity

  1. jpstotz commented on Jul 5, 2025

    @jpstotz
    Collaborator

    This is because CFR and Fernflower do not support to output source code aligned to the line numbers from debug info. They only output line numbers in a format that is not detected by ECD.

  2. zilibaba commented on Oct 9, 2025

    @zilibaba

    I just have updated to Eclipse 2025-06 from Eclipse 2023-06. Line alignment for CFR and Fernflower work well in 2023-6 (ECD 3.3.0), however doesn't work in 2025-6 (ECD 3.5.1). What can I do to assist in issue handling?

  3. jpstotz commented on Oct 11, 2025

    @jpstotz
    Collaborator

    @zilibaba Do you use the Debug or Java perspective? Also it would be important to know what ECD settings you have configured (see Eclipse preferences Java -> Decompiler).

  4. zilibaba commented on Oct 11, 2025

    @zilibaba

    @jpstotz Debug and Java perspectives both works simultaneously and have same behavior. ECD settings identical on both machines:

    Image
  5. nbauma109 commented on Nov 16, 2025

    @nbauma109

    Unifying display of line numbers inside a left margin was a feature that was originally supported in upstream project.
    https://github.com/cpupk/ecd/blob/ba76decd895f15513d151cd52bfd8ecdf14f2fd0/org.sf.feeling.decompiler/src/org/sf/feeling/decompiler/util/DecompilerOutputUtil.java#L439-L442
    This code was removed somehow.
    I remember supporting it for both FernFlower/VineFlower as they output line numbers the same way.
    https://github.com/nbauma109/ecd/blob/57de1fcc09b773eadc3f0e6a189381ec6d6a9299/org.sf.feeling.decompiler/src/org/sf/feeling/decompiler/util/DecompilerOutputUtil.java#L361-L366
    Once line numbers are moved to the left margin, ECD does a best-effort post-process to realign line numbers for debugging.

  6. jpstotz commented on Nov 16, 2025

    @jpstotz
    Collaborator

    @nbauma109 I just checked it: For FernFlower it seems that the DecompilerOutputUtil expects a certain format how the line numbers are included in the source code. This format is only indirectly documented by the used Regex. By updating FernFlower the comment format has changed and thus DecompilerOutputUtil is no longer able to identify the line numbers.

    The complete reformat process has next to no documentation and doesn't seem to be really decompiler specific. IMHO this process needs to be updated, so that each decompiler instance also provides the code (or regex?) for extracting the line numbers. And even more important the whole process needs to be documented well.

  7. jpstotz commented on Nov 23, 2025

    @jpstotz
    Collaborator

    @nbauma109 I pushed my latest work that changed a lot regarding the reformatting process to branch https://github.com/ecd-plugin/ecd/tree/reformat

    In my tests this version looked quite good. You any anybody else feel free to give it a test.

  8. nbauma109 commented on Nov 23, 2025

    @nbauma109

    test ok on my end !

  9. basinilya commented on Nov 28, 2025

    @basinilya
    Author

    Side question: I want to install from the just built update site zip update_site/target/com.github.ecd-plugin.update-3.5.1.zip. I uninstalled the existing version using the "Installed software" tab but the old jars 3.5.1 from 2024 are still in my plugins folder and installing from disk doesn't replace them. If I delete these jars manually then the next install attempt fails with:

    An error occurred during the org.eclipse.equinox.internal.p2.engine.phases.CheckTrust phase.
    session context was:(profile=epp.package.java, phase=org.eclipse.equinox.internal.p2.engine.phases.CheckTrust, operand=, action=).
    Error reading signed content.
    C:\eclipse\plugins\org.sf.feeling.decompiler.vineflower_3.5.1.jar (The system cannot find the file specified)
    
  10. jpstotz commented on Nov 28, 2025

    @jpstotz
    Collaborator

    @basinilya Have you cleaned the "Installation History" of Eclipse (see About -> Installation Details -> tab Installation History). There Eclipse records al the installation changes and unless the old configurations that make use of the ECD jars are deleted Eclipse may try to access plugins that are referenced there.

    In the end it might be easier changing the ECD version. See the scripts update-version for Linux/Windows in the project root folder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions