Re: Jython inherit from Java class



I observed something strange when I tried to compile the jython class:
D:\AUT_TEST\workspace\JyFIT\fit>jythonc JyFitServer.py
processing JyFitServer

Required packages:
fitnesse.util
java.io
java.net
fitnesse.components*

Creating adapters:

Creating .java files:
JyFitServer module
JyFitServer extends fit.FitServer

Compiling .java to .class...
Compiling with args: ['C:\\Programme\\Java\\jdk1.5.0_06\\bin\\javac',
'-classpath',
'D:/AUT_TEST/JyFIT_port/fit;D:\\AUT_TEST\\Jython21\\jython.jar;C:\\Programme\\Java\\jdk1.5.0_06\\lib\\tools.jar;C:\\
Java\\jboss-4.0.0\\server\\default\\lib\\mysql-connector-java-2.0.14-bin.jar;C:\\Java\\jboss-4.0.0\\client\\jboss-j2ee.jar;C:\\Java\\jboss-4.0.0\\client\\jboss-client.jar;C:\\Java\\jboss-4.0.0\\client
\\jbosssx-client.jar;C:\\Java\\jboss-4.0.0\\client\\jnp-client.jar;C:\\Java\\jboss-4.0.0\\client\\jnet.jar;C:\\Java\\jboss-4.0.0\\client\\jboss-common-client.jar;C:\\Java\\jboss-4.0.0\\tomcat-4.1.x\\c
ommon\\lib\\servlet.jar;D:\\AUT_TEST\\Jython21\\jython.jar;D:\\AUT_TEST\\fitnesse\\fitnesse.jar;D:\\AUT_TEST\\JyFIT_port;%CLASSPATH%;.\\jpywork;;D:\\AUT_TEST\\Jython21\\Tools\\jythonc;D:\\AUT_TEST\\wo
rkspace\\JyFIT\\fit\\.;D:\\AUT_TEST\\Jython21\\Lib;D:\\AUT_TEST\\workspace\\JyFIT;D:\\AUT_TEST\\fitnesse\\fitnesse.jar;D:\\AUT_TEST\\Jython21',
'.\\jpywork\\JyFitServer.java']
1 D:\AUT_TEST\Jython21\org\python\core\Py.java:989: as of release 1.4,
'assert' is a keyword, and may not be used as an identifier
(try -source 1.3 or lower to use 'assert' as an identifier)
public static void assert(PyObject test, PyObject message) {
^
D:\AUT_TEST\Jython21\org\python\core\Py.java:995: as of release 1.4,
'assert' is a keyword, and may not be used as an identifier
(try -source 1.3 or lower to use 'assert' as an identifier)
public static void assert(PyObject test) {
^
D:\AUT_TEST\Jython21\org\python\core\Py.java:996: ')' expected
assert(test, Py.None);
^
D:\AUT_TEST\Jython21\org\python\parser\PythonGrammar.java:6739: as of
release 1.5, 'enum' is a keyword, and may not be used as an identifier
(try -source 1.4 or lower to use 'enum' as an identifier)
for (java.util.Enumeration enum = jj_expentries.elements();
enum.hasMoreElements();) {
^
D:\AUT_TEST\Jython21\org\python\parser\PythonGrammar.java:6739: as of
release 1.5, 'enum' is a keyword, and may not be used as an identifier
(try -source 1.4 or lower to use 'enum' as an identifier)
for (java.util.Enumeration enum = jj_expentries.elements();
enum.hasMoreElements();) {
^
D:\AUT_TEST\Jython21\org\python\parser\PythonGrammar.java:6740: as of
release 1.5, 'enum' is a keyword, and may not be used as an identifier
(try -source 1.4 or lower to use 'enum' as an identifier)
int[] oldentry = (int[])(enum.nextElement());
^
D:\AUT_TEST\Jython21\org\python\core\Py.java:996: incompatible types
found : org.python.core.PyObject
required: boolean
assert(test, Py.None);
^
D:\AUT_TEST\Jython21\org\python\core\PyBeanProperty.java:36: warning:
non-varargs call of varargs method with inexact argument type for last
parameter;
cast to java.lang.Object for a varargs call
cast to java.lang.Object[] for a non-varargs call and to suppress this
warning
Object value = getMethod.invoke(iself, Py.EmptyObjects);
^
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
7 errors
1 warning

ERROR DURING JAVA COMPILATION... EXITING

D:\AUT_TEST\workspace\JyFIT\fit>
Looks like something in the Jython core causes the problem
(org\python\core\Py.java) any Ideas what I can do?

.



Relevant Pages

  • Re: How to get enum identifier name as text during runtime?
    ... text name "Mem1" by referencing Mem1, and not its numeric value 0. ... strings in parallel to the enum containing the names as text. ... thing to have a directive that takes any identifier and assignes its ... virtual EnumMap GetEnumMap() PURE; ...
    (microsoft.public.vc.mfc)
  • Re: Type alias in C#
    ... Since enumerations are ValueTypes, ... why does your logic for the presence of the keyword "Structure" not apply to the presence of the keyword "Enumeration" as well? ... I just can't understand how an enum can be considered a structure when it only shares one feature of structures: ... And, using your own argument, the MSDN documentation never refers to an enumeration as a "structure". ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: enum type declaration error
    ... there is C equivalent "enum" type existed in JAVA. ... initial experiment is giving compile error as below. ... public enum returnStatus ...
    (comp.lang.java.programmer)
  • Re: enum is poorly defined
    ... * The C++ enum keyword has problems, mostly for historical reasons, ... * Further, in supporting a range, rather than the individual keywords, ...
    (comp.lang.cpp)
  • Re: Java "interface" vs. OO interface
    ... > I think Java uses interfaces instead of classes because the designers ... To think that the designers of Java and .NET couldn't figure out a good ... Enough for a language to adopt a new keyword ...
    (comp.object)