I’m working on an Eclipse plug-in project.
Using this plug-in, users can create Eclipse Java projects with some specificities. For example, they can add Java classes’ names which will be saved in a file. These Java classes can be created on the src of the project or used from a jar file which must be added to the project classpath. In this case, the plug-in will use reflection to get some data from each class.
There are two different test cases that give the same error because the plug-in can't find the class to instantiate:
A jar contain a class having a name saved in the file is not added to the project classpath. So in this case the classpath is incomplete.
The user of the plug-in updated a jar in which its old version of the jar contained the named class, but the new version of jar does not (which could happen if class was deleted from the new version of the jar). In this case, the plug-in will not find the class but the classpath is complete.
So The plug-in must differentiate between the two test cases when it fails finding the class name using reflection.
How that can be done?