[kepler-dev] Compiling Ptolemy with Java 1.4.2
Dan Higgins
higgins at nceas.ucsb.edu
Thu Jul 27 08:15:54 PDT 2006
Edward,
Thanks for figuring out the problem. Interesting to know that 1.4.2
has a compiler bug.
The bug has disappeared for MatrixToken. However, I still see a
'convert' bug for a number of other Token classes. It looks like the
same problem still exists in other classes. (See below)
[javac] /var/kepler/kepler-nightly-build/ptII/build/src/ptolemy/data/DoubleToken.java:119: convert(ptolemy.data.Token) in ptolemy.data.DoubleToken cannot override convert(ptolemy.data.Token) in ptolemy.data.ScalarToken; attempting to use incompatible return type
[javac] found : ptolemy.data.DoubleToken
[javac] required: ptolemy.data.ScalarToken
[javac] public static DoubleToken convert(Token token)
[javac] ^
[javac] /var/kepler/kepler-nightly-build/ptII/build/src/ptolemy/data/IntToken.java:113: convert(ptolemy.data.Token) in ptolemy.data.IntToken cannot override convert(ptolemy.data.Token) in ptolemy.data.ScalarToken; attempting to use incompatible return type
[javac] found : ptolemy.data.IntToken
[javac] required: ptolemy.data.ScalarToken
[javac] public static IntToken convert(Token token) throws IllegalActionException {
[javac] ^
[javac] /var/kepler/kepler-nightly-build/ptII/build/src/ptolemy/data/ComplexToken.java:115: convert(ptolemy.data.Token) in ptolemy.data.ComplexToken cannot override convert(ptolemy.data.Token) in ptolemy.data.ScalarToken; attempting to use incompatible return type
[javac] found : ptolemy.data.ComplexToken
[javac] required: ptolemy.data.ScalarToken
[javac] public static ComplexToken convert(Token token)
[javac] ^
[javac] /var/kepler/kepler-nightly-build/ptII/build/src/ptolemy/data/FixToken.java:165: convert(ptolemy.data.Token) in ptolemy.data.FixToken cannot override convert(ptolemy.data.Token) in ptolemy.data.ScalarToken; attempting to use incompatible return type
[javac] found : ptolemy.data.FixToken
[javac] required: ptolemy.data.ScalarToken
[javac] public static FixToken convert(Token token) throws IllegalActionException {
[javac] ^
[javac] /var/kepler/kepler-nightly-build/ptII/build/src/ptolemy/data/LongToken.java:116: convert(ptolemy.data.Token) in ptolemy.data.LongToken cannot override convert(ptolemy.data.Token) in ptolemy.data.ScalarToken; attempting to use incompatible return type
[javac] found : ptolemy.data.LongToken
[javac] required: ptolemy.data.ScalarToken
[javac] public static LongToken convert(Token token) throws IllegalActionException {
[javac] ^
[javac] /var/kepler/kepler-nightly-build/ptII/build/src/ptolemy/data/UnsignedByteToken.java:173: convert(ptolemy.data.Token) in ptolemy.data.UnsignedByteToken cannot override convert(ptolemy.data.Token) in ptolemy.data.ScalarToken; attempting to use incompatible return type
[javac] found : ptolemy.data.UnsignedByteToken
[javac] required: ptolemy.data.ScalarToken
[javac] public static UnsignedByteToken convert(Token token)
[javac] ^
[javac] /var/kepler/kepler-nightly-build/ptII/build/src/ptolemy/data/PetiteToken.java:93: convert(ptolemy.data.Token) in ptolemy.data.PetiteToken cannot override convert(ptolemy.data.Token) in ptolemy.data.ScalarToken; attempting to use incompatible return type
[javac] found : ptolemy.data.PetiteToken
[javac] required: ptolemy.data.ScalarToken
[javac] public static PetiteToken convert(Token token)
Edward A. Lee wrote:
>
> Dan:
>
> This is a compiler bug in 1.4.2, unfortunately.
> There is no reason you can't override a static method in this way.
> MatrixToken did not used to have a convert() method, so the problem
> is new, due to my changes.
>
> I've checked in a workaround...
> Sorry about breaking the build.
>
> Edward
>
> At 02:29 PM 7/26/2006, Dan Higgins wrote:
>> Hi Christopher,
>> Our nightly build of Kepler is failing in compiling Ptolemy. The
>> error message is:
>>
>> [javac] ^
>> [javac]
>> C:\work\ptII\build\src\ptolemy\data\LongMatrixToken.java:241: conver
>> t(ptolemy.data.Token) in ptolemy.data.LongMatrixToken cannot override
>> convert(pt
>> olemy.data.Token) in ptolemy.data.MatrixToken; attempting to use
>> incompatible re
>> turn type
>> [javac] found : ptolemy.data.LongMatrixToken
>> [javac] required: ptolemy.data.MatrixToken
>> [javac] public static LongMatrixToken convert(Token token)
>> [javac] ^
>> [javac] C:\work\ptII\build\src\ptolemy\data\LongToken.java:116:
>> convert(ptol
>> emy.data.Token) in ptolemy.data.LongToken cannot override
>> convert(ptolemy.data.T
>> oken) in ptolemy.data.ScalarToken; attempting to use incompatible return
>> type
>> [javac] found : ptolemy.data.LongToken
>> [javac] required: ptolemy.data.ScalarToken
>> [javac] public static LongToken convert(Token token) throws
>> IllegalActio
>> nException {
>>
>> .....
>>
>> Strangely enough this error occurs ONLY when compiling with Java 1.4.2.
>> If I use Java 1.5, Ptolemy compiles with no error messages.
>>
>> Did you guys change something in the Token convert code recently, and
>> Are you using Java 1.5 exclusively now? It would seem better if we could
>> still compile with 1.4.2 (or maybe I am wrong here about the Java
>> versioning being a problem)
>>
>> Dan
>>
>> --
>> *******************************************************************
>> Dan Higgins higgins at nceas.ucsb.edu
>> http://www.nceas.ucsb.edu/ Ph: 805-893-5127
>> National Center for Ecological Analysis and Synthesis (NCEAS) Marine
>> Science Building - Room 3405
>> Santa Barbara, CA 93195
>> *******************************************************************
>>
>>
>> _______________________________________________
>> Kepler-dev mailing list
>> Kepler-dev at ecoinformatics.org
>> http://mercury.nceas.ucsb.edu/ecoinformatics/mailman/listinfo/kepler-dev
>
> ------------
> Edward A. Lee
> Professor, Chair of EECS
> 231 Cory Hall, UC Berkeley, Berkeley, CA 94720-1770
> phone: 510-642-0253 or 510-642-0455, fax: 510-642-2845
> eal at eecs.Berkeley.EDU, http://ptolemy.eecs.berkeley.edu/~eal
>
--
*******************************************************************
Dan Higgins higgins at nceas.ucsb.edu
http://www.nceas.ucsb.edu/ Ph: 805-893-5127
National Center for Ecological Analysis and Synthesis (NCEAS) Marine Science Building - Room 3405
Santa Barbara, CA 93195
*******************************************************************
More information about the Kepler-dev
mailing list