Java #N2 - Using the NetBeans Debugger
Why Stack Overflow recommends it
Stack Overflow users link it when answering questions from people who need a quick walkthrough of debugging in NetBeans instead of guessing at the cause with print statements.
Recommended by 3 people across 3 different months, 2011 to 2017.
What it is
A short screencast by Martin Carlisle, part of his Java video series, introducing the NetBeans debugger. It shows how to set breakpoints, step through code and inspect variables in the NetBeans IDE.
What people said
Recommends Neoraptor · 2011-10 · Stack Overflow · on “Can't get tutorial to work: Build a Physics-Based Platformer in Under an Hour”
Edit: I think i got it wrong bellow actually, it seems it's in the super.create() function. Test this trace bellow anyway just in case and then figure out the debugger and get back with that specific line of code causing trouble. Edit 2: nah, it's not in super.create(), error data confused me for a second, do this bellow. Most probably the variable "world" is not defined. input the first line (trace) into your code like this: trace("world = "+world); listenWhileVisible(world, StepEvent.STEP, world_stepEventHandler, false, 0, true); listenWhileVisible(this, ContactEvent.BEGIN_CONTACT, this_beginContactHandler, false, 0, true); It should show something like: world = null world = undefined; Als
Recommends Boris the Spider · 2013-11 · Stack Overflow · on “Speed Up Web App Development Testing and Debugging on Netbeans 7.3”
You need to use a debugger . Start Glassfish in debug more - this [LINK] explains how to do that. If not starting Glassfish from NeatBeans this SO answer [LINK] gives you the settings to allow remote debugging in NetBeans. Now you are "attached" to the Glassfish JVM via the NetBeans debugger. You can insert breakpoints into the code and the application will stop at them. You can inspect variable values. You can make changes to code and use the "Apply Code Changes" option under the "Deubug" menu to send the changed classes to the JVM. This should reduce the amount of time required to test code changes to a few seconds. Here [this video] is a short YouTube tutorial on the NetBeans debugger.
Recommends Nic · 2017-02 · Stack Overflow · on “why is my customized LinkedList not working?”
I assume that this is for practice or an assignment, java has a generic implementation of LinkedList already see the api docs [LINK] . You may find one of the many texts [LINK] on data structures in java helpul, though usually their implementations use generics rather than Object , For your specific problem you notice that in your testAdd method you call assertEquals(list.get(0), m1); This is comparing a Node to a Money object which will always fail. You could assertEquals(list.get(0).getValue(), m1); This wont work unless you alter the get() method to return a Node rather than an Object as it is currently doing. You are having similar issues with the other tests, where list.get() returns a