I’m using the following code to print the methods of a class:
for (Method meth : c.getDeclaredMethods())
{
System.out.println(" " + shorten(meth.toGenericString()));
}
When it runs on the class I choose, it prints the current methods of my class, plus some methods that I once had, but have since deleted. The navigator in my IDE (netbeans 7.2) does not show the old methods. None of the methods are flagged as bridge or synthetic.
Does the java compiler somehow keep a history?
The compiler doesn’t, and the IDE (netbeans) shouldn’t. Most likely you have built
.classfiles from older.javafiles which still exist. Try doing a clean build (deleting all.classfiles before building again) and see if the problem persists.