Closed Bug 419940 Opened 16 years ago Closed 16 years ago

Incorrect JavaAdapter generation for base class that overrides an abstract method

Categories

(Rhino Graveyard :: Compiler, defect)

1.7R1
x86
Windows XP
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: norrisboyd, Assigned: norrisboyd)

Details

Attachments

(2 files)

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".
Attached patch 419940.patchSplinter Review
Proposed patch
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
Closed: 16 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: