Menu

#418 NullPointerException while using interactions window

6: Crashes
closed-works-for-me
nobody
Other (88)
5
2007-03-22
2005-10-24
Anonymous
No

DrJava Version : 20050814-2234
On Mac OS10.4, JDK 1.5

Hi, I don't have a sourceforge account, but my e-mail
is: timmytingkuliu@hotmail.com. I was doing my
homework, using the interaction and the bug came up.
(Running the main method from the interaction)

Here's the trace and the source code:

java.lang.NullPointerException
at
javax.swing.text.StyledEditorKit$AttributeTracker.updateInputAttributes(StyledEditorKit.java:223)
at
javax.swing.text.StyledEditorKit$AttributeTracker.caretUpdate(StyledEditorKit.java:258)
at
javax.swing.text.JTextComponent.fireCaretUpdate(JTextComponent.java:367)
at
javax.swing.text.JTextComponent$MutableCaretEvent.fire(JTextComponent.java:3232)
at
javax.swing.text.JTextComponent$MutableCaretEvent.stateChanged(JTextComponent.java:3254)
at
javax.swing.text.DefaultCaret.fireStateChanged(DefaultCaret.java:776)
at apple.laf.AquaCaret.fireStateChanged(AquaCaret.java:50)
at
javax.swing.text.DefaultCaret.changeCaretPosition(DefaultCaret.java:1206)
at
javax.swing.text.DefaultCaret.handleSetDot(DefaultCaret.java:1114)
at
javax.swing.text.DefaultCaret.setDot(DefaultCaret.java:1095)
at
javax.swing.text.DefaultCaret.setDot(DefaultCaret.java:1023)
at
javax.swing.text.JTextComponent.setCaretPosition(JTextComponent.java:1400)
at
edu.rice.cs.drjava.ui.AbstractDJPane.setCaretPosition(AbstractDJPane.java:135)
at
edu.rice.cs.drjava.ui.AbstractConsoleController.moveTo(AbstractConsoleController.java:366)
at
edu.rice.cs.drjava.ui.AbstractConsoleController.moveToEnd(AbstractConsoleController.java:350)
at
edu.rice.cs.drjava.ui.AbstractConsoleController$CaretUpdateListener$1.run(AbstractConsoleController.java:232)
at
java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:267)
at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:196)
at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:190)
at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:182)
at
java.awt.EventDispatchThread.run(EventDispatchThread.java:110)

//CS440DL-Fall 2006
//Assignment2--Ting-Ku Liu
//calculation of 3.14159

import java.util.Scanner;

public class assi2 {
public static void main(String[] arg) {
Scanner input = new Scanner(System.in);

double pi;
double x = 1;
double z = 1;

pi = 0;

int numTimes = 0;
// while (pi < 3.14159) {

while(pi < 3.14159 || pi >= 3.1416) {

double term = (4/x)*z;
pi = pi + term;

System.out.println(term +", " + pi);
x = x+2;
z = z*-1;
numTimes = numTimes + 1;
}
System.out.println("Took "+numTimes+" iterations!!!!");
}

}

Discussion

  • Robert Cartwright

    Logged In: YES
    user_id=430590

    Is the bug reproducible on your machine?

    I tried running your program using the latest stable release
    on my Windows XP laptop but I did not encounter any buggy
    behavior.

    -- Corky

     
  • Christopher Warrington

    Logged In: YES
    user_id=666678
    Originator: NO

    Cannot confirm in r4029. If you still have this problem in the latest stable (download it from http://www.drjava.org/\), please post another comment with details. Setting ticket to auto-close.

     
  • Christopher Warrington

    • status: open --> pending-works-for-me
     
  • SourceForge Robot

    Logged In: YES
    user_id=1312539
    Originator: NO

    This Tracker item was closed automatically by the system. It was
    previously set to a Pending status, and the original submitter
    did not respond within 14 days (the time period specified by
    the administrator of this Tracker).

     
  • SourceForge Robot

    • status: pending-works-for-me --> closed-works-for-me
     

Log in to post a comment.