Closed Bug 619296 Opened 14 years ago Closed 14 years ago

Java class wrapping not customizable via WrapFactory

Categories

(Rhino Graveyard :: Core, defect)

head
x86
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: hannesw, Unassigned)

Details

Attachments

(1 file)

The WrapFactory class is supposed to provide an interface for customizing Java object wrapping, but Java classes (an important subset of java objects) are currently not passed through it. Instead, Java class wrapping is hard-coded to NativeJavaClass.
Calling java classes a subset of java objects as I did above is nonsense of course. Still, being able to control class wrapper creation alongside object wrapper creation makes a lot of sense to me.
Adds a wrapJavaClass() method to WrapFactory that returns a new NativeJavaClass. Replace all instances of NativeJavaClass instantiation with calls to WrapFactory.wrapJavaClass().
I committed my patch.

Checking in src/org/mozilla/javascript/NativeJavaClass.java;
/cvsroot/mozilla/js/rhino/src/org/mozilla/javascript/NativeJavaClass.java,v  <--  NativeJavaClass.java
new revision: 1.56; previous revision: 1.55
done
Checking in src/org/mozilla/javascript/NativeJavaPackage.java;
/cvsroot/mozilla/js/rhino/src/org/mozilla/javascript/NativeJavaPackage.java,v  <--  NativeJavaPackage.java
new revision: 1.46; previous revision: 1.45
done
Checking in src/org/mozilla/javascript/WrapFactory.java;
/cvsroot/mozilla/js/rhino/src/org/mozilla/javascript/WrapFactory.java,v  <--  WrapFactory.java
new revision: 1.21; previous revision: 1.20
done
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: