This site requires JavaScript, please enable it in your browser!
Greenfoot back
Busch2207
Busch2207 wrote ...

2013/8/28

How to search through more classes?

Busch2207 Busch2207

2013/8/28

#
Hey, guys! I've got a small problem... In my game "Adventure" I've got over 400 classes and I often used "System.out.println(...)" to test some things... Now I've got the problem, that I nearly always haven't deleted this code-line, after the tests were successful and now I get thousands of printouts and I don't know where they come from or even, what they mean, any more... Now my question: Is there an easy way, to search through all my classes, without opening each class individually?
danpost danpost

2013/8/28

#
You could write a separate program to open and search all the '.java' files in your project for 'System.out.print' and either remove them or produce a list of where each occurrence is.
Busch2207 Busch2207

2013/8/28

#
Why did not I think of that? x) Thank you, I'll do this! :)
LiamClarkWalsh LiamClarkWalsh

2013/8/28

#
If you have a text editor that can do a "Find and Replace" you can always just search for "System.out.println" and replace it with "//System.out.println" so that these lines of code are then commented out and won't run. Very fast 'n easy, especially if your text editor can find/replace for all files in a folder which many freebie text editors can do!
Busch2207 Busch2207

2013/8/28

#
Thank you LiamClarkWalsh, but I already wrote me a programm, that returns a List of all System.out.printlns in all .java-Files of a folder, in an extra .txt-document. :)
LiamClarkWalsh LiamClarkWalsh

2013/8/28

#
cool!
You need to login to post a reply.