Hi Mike and others,
I've got two problems, one of which is the secundary one. My main problem is co-dependencies in Java and NetRexx. Co-dependencies are resolved if we compile the modules together; I'd like to be able to send Java code into the NetRexx compiler. While trying to solve some of these, I resort to mClass = Class.forname("ScopeDialog") con = mClass.getConstructor(Class[] [JFrame.class, boolean.class, InScopeTableModel.class]) inscopeDialog = Maintaining con.newInstance(java.lang.Object[] [inScopeFrame, boolean 0, ist]) This works fine when I have one argument, in our case mostly a JFrame. The compiler complains in this case on the boolean.class, with the message : Error: Partial term is primitive type 'boolean', which cannot have methods or properties The java samples use int.class anyway, which also does not work in NetRexx. What do I do now? best regards, Rene Jansen. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ To unsubscribe from this mailing list ( ibm-netrexx ), please send a note to [hidden email] with the following message in the body of the note unsubscribe ibm-netrexx <e-mail address> |
>
> Co-dependencies don't really have a solution. > > int and boolean (etc.) are Java reserved words. They cannot be used for > identifiers. > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > Mike Cowlishaw, IBM Fellow Mike, isn't it possible to send .nrx and .java into the compiler, and have the generated java and the .java files go unmodified into the java compiler so it can resolve the signatures? On the second point, it *is* valid use in java to use int.class and boolean.class as members of an array of Class[] . It is NetRexx that is flagging it down, saying that you cannot have methods or properties on primitive types. I think that just might be wrong in this context. best regards, Rene. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ To unsubscribe from this mailing list ( ibm-netrexx ), please send a note to [hidden email] with the following message in the body of the note unsubscribe ibm-netrexx <e-mail address> |
In reply to this post by rvjansen
>
> The Java language spec. (Gosling & co., 1996) says these cannot be used as > identifiers (section 3.9), and so NetRexx enforces that rule to save > people > from generating Java source files that are illegal. Possibly there's > some > later change, but that would be an incompatible change, so I hope not :-(. > It's not something I would change at this point. > I typed in the following sample from The Java Developers Almanac 1.4 , Chan et al., page 111, Getting a Constructor of a Class Object: class test { public static void main(String[] args){ try{ java.lang.reflect.Constructor con = java.awt.Point.class.getConstructor(new Class[] {int.class,int.class}); } catch (Exception e) {}; } } This compiles without any pain. I spent some time browsing "The Java Language Specification", and would like to quote paragraph 15.8.2: A *class literal* is an expression consisting of the name of a class, interface, array or primitive type followed by a '.' and the token *class*. This is from the 2000 edition. The concept of an int.class is first mentioned in the 1.1 update to the 1996 edition. (http://java.sun.com/docs/books/jls/first_edition/html/1.1Update.html , D.7.3) I added a constructor that makes the dialog always modal (so I would not need the boolean.class right now), but I really like to be able to use this. best regards, Rene-Vincent Jansen. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ To unsubscribe from this mailing list ( ibm-netrexx ), please send a note to [hidden email] with the following message in the body of the note unsubscribe ibm-netrexx <e-mail address> |
In reply to this post by rvjansen
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1 On Tue, 18 Feb 2003 17:07:01 +0000, Mike Cowlishaw wrote: Hello, shouldn't this be Integer.TYPE ? I used it several times, and it works... Patric >Ah, sorry .. yes, it's coming back to me. Yes I think int.class is >allowed -- see 'Special names' in the NetRexx supplement document. >NetRexx does anything that 1.1 can do, I believe. >- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - >Mike Cowlishaw, IBM Fellow >IBM UK (MP5), PO Box 31, Birmingham Road, Warwick, CV34 5JL >mailto:[hidden email] -- http://www2.hursley.ibm.com/decimal >~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >To unsubscribe from this mailing list ( ibm-netrexx ), please send a note to >[hidden email] >with the following message in the body of the note >unsubscribe ibm-netrexx <e-mail address> PGP Public Key Fingerprint: 2636 F26E F523 7D62 4377 D206 7C68 06BB -----BEGIN PGP SIGNATURE----- Version: PGPsdk version 1.7.1 (C) 1997-1999 Network Associates, Inc. and its affiliated companies. iQA/AwUBPlJ1vHxoBrvMu8qQEQLgrwCfS4JNiBM6okmMFMh6M2Xunmg47WYAoKjw 2TnBnE2QTX6HUVUqvm91mEQ4 =bmmf -----END PGP SIGNATURE----- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ To unsubscribe from this mailing list ( ibm-netrexx ), please send a note to [hidden email] with the following message in the body of the note unsubscribe ibm-netrexx <e-mail address> |
Free forum by Nabble | Edit this page |