File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes can anyone please help me spot my errors? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "can anyone please help me spot my errors?" Watch "can anyone please help me spot my errors?" New topic
Author

can anyone please help me spot my errors?

Anissa Pary
Ranch Hand

Joined: Jan 02, 2012
Posts: 40
Hello. I have 2 classes


and Test class

1 failure at resizing It says resizing too often is inefficient and resizing was done 13 times. But I don't see why. Can anyone please help!

Jeff Verdegan
Bartender

Joined: Jan 03, 2004
Posts: 6109
    
    6

Anissa Pary wrote:
I am getting 6 errors and when I am debugging it is NullPointer in lines 136 and 140 and 137. But I don't see why. Can anyone please help!



That looks like 3 errors, not 6. And the code you posted doesn't have those line numbers.
Scott Kimberly
Greenhorn

Joined: Mar 04, 2012
Posts: 25
Jeff Verdegan wrote:
Anissa Pary wrote:
I am getting 6 errors and when I am debugging it is NullPointer in lines 136 and 140 and 137. But I don't see why. Can anyone please help!



That looks like 3 errors, not 6. And the code you posted doesn't have those line numbers.


Assuming thats all the code for the program, there are 214 lines. The errors are at like 48 or (line 48 i think is really line 136) of that last large block.

I find that null pointer exceptions come from variables that can be set to null be shouldnt be for the purposes of your code.
Anissa Pary
Ranch Hand

Joined: Jan 02, 2012
Posts: 40
Sorry I have made a mistake and printed wrong stuff this six mistakes was from another program and here it is just a failure...
Jeff Verdegan
Bartender

Joined: Jan 03, 2004
Posts: 6109
    
    6

Anissa Pary wrote:Sorry I have made a mistake and printed wrong stuff this six mistakes was from another program and here it is just a failure...


Okay, so, what exact errors are you getting here and on which exact lines are they occurring?
Anissa Pary
Ranch Hand

Joined: Jan 02, 2012
Posts: 40
Jeff Verdegan wrote:
Anissa Pary wrote:Sorry I have made a mistake and printed wrong stuff this six mistakes was from another program and here it is just a failure...


Okay, so, what exact errors are you getting here and on which exact lines are they occurring?

it is saying runs:6/6 errors:0 failures: 1
junit.framework.AssertionFailedError: Resizing too often (inefficient) expected: <-1> but was <13> at CircularArrayQueueTest.testResize(CircularArrayQueueTest.java:122). So, it means

in the method:

but when I am changing the value of it is still complaining and it fails only when I run the code
Anissa Pary
Ranch Hand

Joined: Jan 02, 2012
Posts: 40
Anissa Pary wrote:
Jeff Verdegan wrote:
Anissa Pary wrote:Sorry I have made a mistake and printed wrong stuff this six mistakes was from another program and here it is just a failure...


Okay, so, what exact errors are you getting here and on which exact lines are they occurring?

it is saying runs:6/6 errors:0 failures: 1
junit.framework.AssertionFailedError: Resizing too often (inefficient) expected: <-1> but was <13> at CircularArrayQueueTest.testResize(CircularArrayQueueTest.java:122). So, it means

in the method:

but when I am changing the value of it is still complaining and it fails only when I run the code

OK get it working now anyway thanks for looking in my code!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: can anyone please help me spot my errors?