You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by "Francisco Jr." <fx...@solar.com.br> on 2000/10/14 01:56:23 UTC
[C2] Jikes.java issues and Patch
Hi all,
I found some issues using Jikes compiler.
I'm using Jikes 1.12 08/01/2000
Win98
C2 10/12/2000 cvs Version.
First:
--nowarn compiler switch isn't used anymore. It's now just -nowarn.
With --nowarn Jikes outputed a warning saying that this switch was not
reconized and Jikes.java was throwing NumberFormatException when trying to read
Emacs-format error messages from this warning.
Second:
I think that return evaluation of compile() should change.
Jikes return an exitValue of 1 on success and failure. And that was confusing
Cocoon2 too. Even when Jikes compiled code successfully, C2 think taht there
was an error. So I think that compile() return value shouldn't rely on it
anymore. I think it can check just size of error buffer returned from Jikes if
there is an error.
Third:
I think that Unix guys wouldn't have this problem :) To check errors,
Jikes.java on parseError() creates a StringTokenizer with ':' as a separator.
The problem is that in Windows the full name of file returned by Jikes includes
drive letter information followed by ':' (i.e.: d:/somefile.java:70:63:70:63).
So you got the problem. Letter 'd' is returned as file name (first token) and
'somefile.java'is the second token returned and at parserError, this second
token is assumed to be the startline number. So I get NumberFormatException :(
I'm sending a patch to first and second issues. I'm think about third... The
second token could be tested to see if it is a String or not, or could check
operating system ( if (windows) append second token to first. ) I don't know...
Maybe some of you could give a elegant solution to this :)
Thanks very much!
File: org/apache/cocoon/components/language/programming/java/Jikes.java
76c76
< args.add("--nowarn");
---
> args.add("-nowarn");
108c108
< return ((exitValue == 0) && (tmpErr.size() > 0));
---
> return (tmpErr.size() == 0);
Sorry for formating. My email client is a little crazy :)
---------------------
Francisco Jr.
fxjr@solar.com.br