aspose file tools*
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


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
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
Author

Found a Bug In JDK 1.3.

Prasad Ballari
Ranch Hand

Joined: Sep 23, 2000
Posts: 149
Friends,
(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 (http://java.sun.com/cgi-bin/bugreport.cgi). Include your program and the following diagnostic in your report. Thank you. java.lang.NullPointerException at com.sun.tools.javac.v8.comp.TransInner.access(TransInner.java:722) at com.sun.tools.javac.v8.comp.TransInner._case(TransInner.java:1558) at com.sun.tools.javac.v8.tree.Tree$Select.visit(Tree.java:963) at com.sun.tools.javac.v8.tree.TreeTranslator.translate(TreeTranslator.java:35) at com.sun.tools.javac.v8.comp.TransInner._case(TransInner.java:1552) at com.sun.tools.javac.v8.tree.Tree$Select.visit(Tree.java:963) at com.sun.tools.javac.v8.tree.TreeTranslator.translate(TreeTranslator.java:35) at com.sun.tools.javac.v8.tree.TreeTranslator.translate(TreeTranslator.java:47) at com.sun.tools.javac.v8.comp.TransInner._case(TransInner.java:1461) at com.sun.tools.javac.v8.tree.Tree$Apply.visit(Tree.java:785) at com.sun.tools.javac.v8.tree.TreeTranslator.translate(TreeTranslator.java:35) at com.sun.tools.javac.v8.tree.TreeTranslator._case(TreeTranslator.java:179) at com.sun.tools.javac.v8.tree.Tree$Exec.visit(Tree.java:699) at com.sun.tools.javac.v8.tree.TreeTranslator.translate(TreeTranslator.java:35) at com.sun.tools.javac.v8.tree.TreeTranslator.translate(TreeTranslator.java:47) at com.sun.tools.javac.v8.tree.TreeTranslator._case(TreeTranslator.java:111) at com.sun.tools.javac.v8.tree.Tree$Block.visit(Tree.java:492) at com.sun.tools.javac.v8.tree.TreeTranslator.translate(TreeTranslator.java:35) at com.sun.tools.javac.v8.tree.TreeTranslator._case(TreeTranslator.java:100) at com.sun.tools.javac.v8.comp.TransInner._case(TransInner.java:1418) at com.sun.tools.javac.v8.tree.Tree$MethodDef.visit(Tree.java:441) at com.sun.tools.javac.v8.tree.TreeTranslator.translate(TreeTranslator.java:35) at com.sun.tools.javac.v8.comp.TransInner._case(TransInner.java:1355) at com.sun.tools.javac.v8.tree.Tree$ClassDef.visit(Tree.java:402) at com.sun.tools.javac.v8.tree.TreeTranslator.translate(TreeTranslator.java:35) at com.sun.tools.javac.v8.comp.TransInner.translate(TransInner.java:1317) at com.sun.tools.javac.v8.comp.TransInner.translateTopLevelClass(TransInner.java:1583) at com.sun.tools.javac.v8.JavaCompiler.compile(JavaCompiler.java:397) at com.sun.tools.javac.v8.Main.compile(Main.java:247) at com.sun.tools.javac.Main.main(Main.java:16)
Regards
Prasad

------------------

[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
Sheriff

Joined: Aug 26, 2000
Posts: 10065
Prasad,
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.
Regards
Prasad
Viji Bharat
Ranch Hand

Joined: Sep 18, 2000
Posts: 101
Prasad:
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: 3201
    
    2
Prasad, where are your notes???
-Paul.
------------------
Get Certified, Guaranteed!
(Now Revised for the new Pattern)
www.enthuware.com/jqplus


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

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

Thanks for your greate interest.
Regards
Prasad
Sahir Shibley
Ranch Hand

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


<PRE>
public class Outer{
public static class Inner{
public static int i = 1;
}
public static void main(String[] args)
{
System.out.println(Outer.Inner.i);
}
}
</PRE>
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
</HTML>
[This message has been edited by Sahir Shibley (edited October 25, 2000).]
Jonathan Jeban
Ranch Hand

Joined: Oct 08, 2000
Posts: 52
Hi,
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
Jeban
Ajith Kallambella
Sheriff

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.
Ajith


Open Group Certified Distinguished IT Architect. Open Group Certified Master IT Architect. Sun Certified Architect (SCEA).
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Found a Bug In JDK 1.3.
 
Similar Threads
nested class method
about Sun Guoqiao's mock-exam-02-38
u cannot subclass the array class?
I crashed the Java 1.3.1 compiler
I have rewritten my mock exam and put it at http://www.jiris.com/