[OCP 21 book] | [OCP 17 book] | [OCP 11 book] | [OCA 8 book] [OCP 8 book] [Practice tests book] [Blog] [JavaRanch FAQ] [How To Ask Questions] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
Originally posted by Jeanne Boyarsky:
David,
I suspect that Garage is using static data. Can you post the relevant methods and data members from that class?
[OCP 21 book] | [OCP 17 book] | [OCP 11 book] | [OCA 8 book] [OCP 8 book] [Practice tests book] [Blog] [JavaRanch FAQ] [How To Ask Questions] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
Originally posted by David Dickinson:
Jeanne,
I'm afraid I can't post the methods but the ArrayLists which hold the objects are static because I have a method which returns the ArrayList.size()
Thank you for explaining that but im afraid I don't have any idea how to clear the reference to the garage? Could you advise me?
Thank-you
Originally posted by David Dickinson:
The ArrayLists are used in a class which extends AbstractTableModel. One of the methods is getRowCount() and it calls a getArrayListSize method in another class which holds the array, which in turn calls the ArrayList.size() method, for some reason Eclipse insists that the getArrayListSize method must be static and then insists the ArrayList is static as well.
Any idea why this is?
I've just accepted it and moved on but I don't know how to clear my arrays now, and the tests are holding me up.
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Originally posted by David Dickinson:
This is the error message in eclipse..
The method getArrayListSize() from the type Garage is not static
This is the code which is causing the problem...
Problem method in my implementation of AbstractTableModel
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Don't get me started about those stupid light bulbs. |