Incorrect JavaAdapter generation for base class that overrides an abstract method

RESOLVED FIXED in 1.7R1

Status

Rhino
Compiler
RESOLVED FIXED
10 years ago
10 years ago

People

(Reporter: Norris Boyd, Assigned: Norris Boyd)

Tracking

1.7R1
1.7R1
x86
Windows XP

Details

Attachments

(2 attachments)

(Assignee)

Description

10 years ago
If you define a class as so:
public abstract class BaseFoo {
  public abstract String doSomething();
}
public class Foo extends BaseFoo {
  public String doSomething() {
     return "hello world";
  }
}

and you do in Rhino:
var aFoo = new JavaAdapter(Packages.com.google.Foo, {});

what is the return of:
aFoo.doSomething()

The answer is... the string 'undefined'!

Should be "hello world".
(Assignee)

Comment 1

10 years ago
Created attachment 306120 [details] [diff] [review]
419940.patch

Proposed patch
(Assignee)

Comment 2

10 years ago
Created attachment 306121 [details]
testsrc\org\mozilla\javascript\tests\Bug419940Test.java
(Assignee)

Comment 3

10 years ago
Fixed:

Checking in testsrc/org/mozilla/javascript/tests/Bug419940Test.java;
/cvsroot/mozilla/js/rhino/testsrc/org/mozilla/javascript/tests/Bug419940Test.jav
a,v  <--  Bug419940Test.java
initial revision: 1.1
done
Checking in src/org/mozilla/javascript/JavaAdapter.java;
/cvsroot/mozilla/js/rhino/src/org/mozilla/javascript/JavaAdapter.java,v  <--  Ja
vaAdapter.java
new revision: 1.112; previous revision: 1.111
done
Status: NEW → RESOLVED
Last Resolved: 10 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.