Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8724403
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T07:49:25+00:00 2026-06-13T07:49:25+00:00

I’ve got two class files that I’m trying to prove were generated from the

  • 0

I’ve got two class files that I’m trying to prove were generated from the very same Scala source.

Upon decompiling the class files into Java I got two Java files that are exactly equivalent semantically. However they have different @ScalaSignature annotations inside them. I got the following outputs upon running “javap -verbose” on the class files:

...
SourceFile: "ABC.scala"
ScalaSig: length = 0x3
 05 00 00
Signature: #140                         // <T:Ljava/lang/Object;>Lcom/xyz/ABC;Lscala/ScalaObject;Lscala/Product;
Lscala/Serializable;
RuntimeVisibleAnnotations:
  0: #141(#142=s#143)
minor version: 0
major version: 49
flags: ACC_PUBLIC, ACC_SUPER
---

from one file, and from the other:

...
SourceFile: "ABC.scala"
ScalaSig: length = 0x3
 05 00 00
Signature: #140                         // <T:Ljava/lang/Object;>Lcom/xyz/ABC;Lscala/ScalaObject;Lscala/Product;
Lscala/Serializable;
RuntimeVisibleAnnotations:
  0: #141(#142=s#143)
minor version: 0
major version: 49
flags: ACC_PUBLIC, ACC_SUPER
...

Is it possible for the two class files to have been obtained from the same Scala source, be annotated with the same ScalaSig, Signature, etc., and yet have different @ScalaSignature annotations?

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T07:49:26+00:00Added an answer on June 13, 2026 at 7:49 am

    It is possible for two scala source files to end up with the same byte code (except for the sig). Indeed, it’s the sig that tells you that the original source files were different. So no, it’s not possible to prove that two class files came from the same scala source.

    For instance, if two classes have the same methods but with different type parameters, then you’d get the same bytecode, but different sigs.

    As a trivial example, look at the following class:

    class Foo {
      def fn1(t: String) = "" + t
      def fn2[T <: String](t : T) = "" + t
    }
    

    These two methods have exactly the same byte code generated, but the sigs will be different:

    public java.lang.String fn1(java.lang.String);
      Code:
       Stack=1, Locals=2, Args_size=2
       0:   aload_1
       1:   invokestatic    #12; //Method java/lang/String.valueOf:(Ljava/lang/Object;)Ljava/lang/String;
       4:   areturn
      LineNumberTable:
       line 2: 0
    
      LocalVariableTable:
       Start  Length  Slot  Name   Signature
       0      5      0    this       LFoo;
       0      5      1    t       Ljava/lang/String;
    
      Signature: length = 0x2
       00 12
    
    public java.lang.String fn2(java.lang.String);
      Code:
       Stack=1, Locals=2, Args_size=2
       0:   aload_1
       1:   invokestatic    #12; //Method java/lang/String.valueOf:(Ljava/lang/Object;)Ljava/lang/String;
       4:   areturn
      LineNumberTable:
       line 3: 0
    
      LocalVariableTable:
       Start  Length  Slot  Name   Signature
       0      5      0    this       LFoo;
       0      5      1    t       Ljava/lang/String;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got a string that has curly quotes in it. I'd like to replace
I am doing a simple coin flipping experiment for class that involves flipping a
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I'm trying to create an if statement in PHP that prevents a single post
I have a bunch of posts stored in text files formatted in yaml/textile (from
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
For some reason, after submitting a string like this Jack’s Spindle from a text
I am trying to understand how to use SyndicationItem to display feed which is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.