473,327 Members | 1,976 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

fix for Jython bug related to inaccessable constructors

I just managed to track down and fix a bug in the jython compiler. I don't
know if this is the right place to post it and call attention to it.

I'm writing a motorcycle transmission simulation in Java3D and Jython, which
is on the web at
<http://home.cfl.rr.com/genecash/transmission_applet/transmission_applet.html>
if anyone's interested.

At the moment, I was adding the star cam to the end of the shift drum, and the
associated cam follower.

OK, the shift drum is animated using a "RotationInterpolator" object, so I
decided to subclass this object as a "StarInterpolator" and add the little bit
of code to update the follower position every frame.

Well, so far, so good. It took me a day or so until I had it done. I was
testing it with the command line interpreter and it was all peachy. Then I
tried to compile it so I could put it up on the web, and it pukes up "cannot
resolve symbol" errors on the new subclass.

Ok, so the "RotationInterpolator" constructor has the following signature:
public RotationInterpolator(Alpha, TransformGroup);
public RotationInterpolator(Alpha, TransformGroup, Transform3D, float, float);

Well for some reason, jythonc is emitting code to handle the no-argument
RotationInterpolator() as well, and of course this chokes because there is no
such thing.

According to the Sun Java3D documentation, that is. Ahem. According to the
javap output, there *IS* a RotationInterpolator() constructor, but it's only
package accessable. OK, so that means I can't see it, but it's still in the
signature so jythonc is trying to deal with it.

In the addConstructors function in $JYTHON_HOME/Tools/jythonc/proxies.py, it
goes through the constructors and creates a list for each one. There's a
variable called "access" which is 0 if you can't see the constructor.

So this is the patch:

def addConstructors(self, c):
for constructor in c.getDeclaredConstructors():
access = constructor.modifiers
if isPrivate(access):
continue
if isNative(access):
access = access & ~NATIVE
if isProtected(access):
access = access & ~PROTECTED | PUBLIC
+ if not access:
+ continue
parameters = tuple(constructor.parameterTypes)
throws = constructor.exceptionTypes
self.jconstructors.append( (access, parameters, throws) )

-gc

--
Thu 14-Oct-2004: 26 days (3 weeks, 5 days) until the release of HALO 2
Jul 18 '05 #1
0 944

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Michael Chermside | last post by:
Ype writes: > For the namespaces in Jython this 'Python internal thread safety' > is handled by the Java class: > > http://www.jython.org/docs/javadoc/org/python/core/PyStringMap.html > > which...
6
by: Dave Benjamin | last post by:
Hey good people, I've been doing a lot of simultaneous Jython and CPython programming lately, and just wanted to say, with no intended ill will toward any of the individuals who have been...
4
by: angel | last post by:
A java runtime environment includes jvm and java class (for example classes.zip in sun jre). Of course jython need jvm,but does it need java class. Thanx
7
by: Jan Gregor | last post by:
Hello I found that jython catches exact java exceptions, not their subclasses. Is there some way to get around this limitation (or error) ? My program has class representing database source...
1
by: scott | last post by:
I installed darwinports and did a "sudo port install jython" ------------------------- scott$ which jython /opt/local/bin/jython ------------------------- Jython works in interactive...
12
by: Mark Fink | last post by:
I wrote a Jython class that inherits from a Java class and (thats the plan) overrides one method. Everything should stay the same. If I run this nothing happens whereas if I run the Java class it...
3
by: Sloan.Kohler | last post by:
Is Jython development dead or has it just seemed that way for over a year?. The jython.org website has a recent new appearance (but no new content) and there is some message traffic on the...
4
by: Neil Wallace | last post by:
Hi all, I am a novice Python/Jython programmer, and Ubuntu user. Ubuntu still only supports only version 2.1 of Jython. I have used the GUI installer of Jython 2.2, and installed it to the...
5
by: sarup26 | last post by:
Hello .. I would like to know more about Python and Jython? What is the difference between both of them? What is the future for Jython and which are the areas where it is used? Swot
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.