File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Found a Bug In JDK 1.3. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Found a Bug In JDK 1.3." Watch "Found a Bug In JDK 1.3." New topic

Found a Bug In JDK 1.3.

Prasad Ballari
Ranch Hand

Joined: Sep 23, 2000
Posts: 149
(Hope such questions will not be asked in the exam.)
Its unbelivable for me to accept this, that i have found out one Bug in JDK 1.3.
What i tried to do is,I wanted to access the static data field residing inside the static inner class.That time it popped up as Bug & asked me report to Sun.(I did that).
Following is code.

Now i am bit confused about this static concept.Paul has really taken hard efforts to explain me this. I think some percentage i have understood.Any way sooner i will be able ,make one exhaustive notes & examples on this Static inner classes.I request paul to go through my notes, & advice me if would any mistakes.

Pls test this on ur m/c and tell me whether same result it pops up
The result i got is--
An exception has occurred in the compiler (1.3.0). Please file a bug at the Java Developer Connection ( Include your program and the following diagnostic in your report. Thank you. java.lang.NullPointerException at at at$Select.visit( at at at$Select.visit( at at at at$Apply.visit( at at at$Exec.visit( at at at at$Block.visit( at at at at$MethodDef.visit( at at at$ClassDef.visit( at at at at at at


[This message has been edited by Prasad Ballari (edited October 24, 2000).]
And Mapraputa added UBB code here.
[This message has been edited by Mapraputa Is (edited October 24, 2000).]
Mapraputa Is
Leverager of our synergies

Joined: Aug 26, 2000
Posts: 10065
I tried your code on JDK1.2.2 and got compiler error message: No variable InnerII defined in class OuterII
But both

compile and run fine.

Uncontrolled vocabularies
"I try my best to make *all* my posts nice, even when I feel upset" -- Philippe Maquet
Prasad Ballari
Ranch Hand

Joined: Sep 23, 2000
Posts: 149
Mapraputa ,
Thanks for concern.
Viji Bharat
Ranch Hand

Joined: Sep 18, 2000
Posts: 101
I think you get the error because you have the declaration and initialization as
new OuterII().InnerII.i
Well, I tried this in 1.3 too and I got the same error you have posted. However, I haven't tried it in 1.2 though.
However, I think the correct declaration should be new OuterII.InnerII().i. This compiles and works fine.
[This message has been edited by Viji Bharat (edited October 25, 2000).]
Paul Anilprem
Enthuware Software Support
Ranch Hand

Joined: Sep 23, 2000
Posts: 3635
Prasad, where are your notes???
Get Certified, Guaranteed!
(Now Revised for the new Pattern)

Enthuware - Best Mock Exams and Questions for Oracle Java Certifications
Quality Guaranteed - Pass or Full Refund!
Prasad Ballari
Ranch Hand

Joined: Sep 23, 2000
Posts: 149
Sorry for the delay. I am still preparing..I will post it with in 2 days.

Thanks for your greate interest.
Sahir Shibley
Ranch Hand

Joined: Apr 08, 2000
Posts: 275
The correct way to refer to the variable is

public class Outer{
public static class Inner{
public static int i = 1;
public static void main(String[] args)
Normally the compiler should report an error. But it caused a dump becuse of a bug in the compiler. Dont worry about it. Its bug with minimal or no impact on the user.
Just dont do that sort of thing again.
Rgds - Sahir
[This message has been edited by Sahir Shibley (edited October 25, 2000).]
Jonathan Jeban
Ranch Hand

Joined: Oct 08, 2000
Posts: 52
Initially , when I started to learn about inner class , I too
run into similiar problems . One such problem I posted in
Beginner's section is this..I used JDK 1.2
Ajith Kallambella

Joined: Mar 17, 2000
Posts: 5782
I just found out that this bug has already been reported. Read more about it in the Bug Prade.

Open Group Certified Distinguished IT Architect. Open Group Certified Master IT Architect. Sun Certified Architect (SCEA).
I agree. Here's the link:
subject: Found a Bug In JDK 1.3.
It's not a secret anymore!