On Thu, 15 Oct 1998 00:23:45 -0500, Trevor Harmon wrote:
>I am trying to compile the attached program in javac. I've tested it
>under Sun's JDK 1.1.5 on Solaris, Symantec's Visual Cafe (forgot which
>version, but it's based on JDK 1.1.3) on Windows NT, and Blackdown's JDK
>1.1.6v5 on Linux. All of them give the exact same result:
>
>java.lang.NullPointerException:
> at java.util.Hashtable.get(Hashtable.java)
> at sun.tools.asm.ConstantPool.put(ConstantPool.java)
> at sun.tools.asm.Instruction.collect(Instruction.java)
> at sun.tools.asm.Assembler.collect(Assembler.java)
> at sun.tools.javac.SourceClass.compileClass(SourceClass.java)
> at sun.tools.javac.SourceClass.compile(SourceClass.java)
> at sun.tools.javac.Main.compile(Main.java)
> at sun.tools.javac.Main.main(Main.java)
>
>The problem appears to be related somehow to the System.out.println
>statements, probably the combination of the println's with the ?:
>operator. If you take out the println's, then the program compiles fine.
Happens with 1.1.6 and 1.1.7 on os/2, too.
But Jikes gives
!!Found 1 semantic error compiling "GIF2EPROM.java":
!!
!! 147. binary += pixels[y * FONT_HEIGHT + x] == 0 ? System.out.print("1") :
System.out.print("0");
!! <------------------->
!!*** Error: An expression of type "void" is not valid in this context
... and there it is: adding something void to an integer variable.
Cheers
Rainer