<< Back to previous view

[CLJ-956] [java.lang.ClassFormatError: Duplicate method name&signature] when using gen-class Created: 20/Mar/12  Updated: 01/Mar/13  Resolved: 09/Nov/12

Status: Closed
Project: Clojure
Component/s: None
Affects Version/s: Release 1.3
Fix Version/s: None

Type: Defect Priority: Major
Reporter: Daniel Ribeiro Assignee: Unassigned
Resolution: Declined Votes: 0
Labels: AOT
Environment:

$ java -version
java version "1.6.0_29"
Java(TM) SE Runtime Environment (build 1.6.0_29-b11-402-11M3527)
Java HotSpot(TM) 64-Bit Server VM (build 20.4-b02-402, mixed mode)



 Description   

Hi,

When extending a class that defines a method with the signature "public void load();", I get the following load time error:

java.lang.ClassFormatError: Duplicate method name&signature

Looking into javap, I see that in fact gen-class is generating two entries for the load method. Prefix does not help in this case, as the defined load method is generated anyway.

Cheers,

  • Daniel


 Comments   
Comment by Daniel Ribeiro [ 22/Mar/12 5:10 AM ]

Hi,

I've create this small sample project to exemplify the bug ocurring: https://github.com/danielribeiro/ClojureBugReport

Cheers,

  • Daniel
Comment by Daniel Ribeiro [ 24/Mar/12 6:57 PM ]

Note that the name load is not special: it works with any abstract method, no matter the name.

Comment by Daniel Ribeiro [ 24/Mar/12 7:34 PM ]

Not a bug: I was declaring the method load, which was already defined on the abstract class. The docs do mention this:

http://clojuredocs.org/clojure_core/clojure.core/gen-class

Comment by Stuart Sierra [ 09/Nov/12 8:40 AM ]

Closed as not-a-bug.

Generated at Wed Aug 27 20:04:40 CDT 2014 using JIRA 4.4#649-r158309.