Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--ignore-missing-classes and updating CLASSPATH #260

Open
mkr-plse opened this issue Apr 20, 2020 · 3 comments
Open

--ignore-missing-classes and updating CLASSPATH #260

mkr-plse opened this issue Apr 20, 2020 · 3 comments

Comments

@mkr-plse
Copy link

When japicmp is run as follows java -jar japicmp/target/japicmp-0.14.3-jar-with-dependencies.jar -n ~/Downloads/jmh-core-1.23.jar -o ~/Downloads/jmh-core-1.21.jar, the following error shows up:

E: Could not load 'Class not found: org.apache.commons.math3.stat.descriptive.StatisticalSummary': org.apache.commons.math3.stat.descriptive.StatisticalSummary. Please make sure that all libraries have been added to the classpath (CLASSPATH=) or try the option '--ignore-missing-classes'

Updating the CLASSPATH with commons-math3-3.6.1.jar doesn't fix the issue. Ignoring the missing classes however fixes the issue. Will ignoring the missing classes (from other jars) likely affect the result of comparison between the input old and new jars, if I am just looking for any changes to the method signatures in the classes in the input jars?

@siom79
Copy link
Owner

siom79 commented Apr 21, 2020

Adding the jar to the normal Classpath won't help. Try adding it with the --new-classpath or --old-classpath option of the tool.

If you leave out dependencies, japicmp cannot detect changes related to interfaces or superclasses that stem from the libary.

@mkr-plse
Copy link
Author

Adding the jar to the normal Classpath won't help. Try adding it with the --new-classpath or --old-classpath option of the tool.

Thanks. This addresses the problem. Can this issue track updating the error message Please make sure that all libraries have been added to the classpath (CLASSPATH=) to suggest updating --old-classpath and --new-classpath appropriately?

If you leave out dependencies, japicmp cannot detect changes related to interfaces or superclasses that stem from the libary.

If I am just interested in comparing the method signatures for just the input old (O) and new (N) jars, I am not sure how the absence of dependent jars (D1 and D2) will cause a problem. Consider the following cases:

  • If a class in O implements an interface method from D1, D1 is updated to D2 and methods are modified in D2, then the corresponding class in N (if it uses D2) will be updated to reflect the changes.
  • Similarly, if class in O extends some class in D1, and D1 is updated to D2, then the class in N will also be updated to reflect the changes.

Of course, comparison of classes in D1 and D2 will be ignored, and any semantic changes that affect the input classes in O and N will also be ignored. But, is there any case where the syntactic changes in the input jars be ignored by using the --ignore-missing-classes?

@jrenaat
Copy link

jrenaat commented Oct 6, 2021

Adding the jar to the normal Classpath won't help. Try adding it with the --new-classpath or --old-classpath option of the tool.

If you leave out dependencies, japicmp cannot detect changes related to interfaces or superclasses that stem from the libary.

I might point out that if you use the default ClassPathMode.ONE_COMMON_CLASSPATH, and you just specify one of the two classpath options, as you suggested above, this will result in the following error: "E: Please provide both options: --old-classpath and --new-classpath". In other words, both options have to be set, even if you want to use one common classpath, which is a bit counterintuitive.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants